Archive for the Internet Explorer Category

CSS hack for IE6 and IE7

Posted in CSS, Internet Explorer on March 2, 2008 by Bala

Everyone know what a underscore hack is, but it fails in IE. Before getting into the Underscore hack, we need to know how it works,

If a property say height is prefixed with _ or - IE6 will assume that as a valid property but FF will ignore it, so for any IE6 specific style we can use _ or -. But in IE7 that bug was fixed, so if any property is followed by _ or -, IE7 will ignore it similar to Firefox.

Dont lose, still IE is not that robust, if you place a ‘*’ before the property, it considers, now that is something to smile about and thinking deeper. So if a property is prefixed by a *, it will be considered as a valid property, but we can a small problem here, even IE6 will take this as a valid one. So summing up everything we have

 

*

_ or -

Firefox

Invalid

Invalid

IE6

Valid

Valid

IE7

Valid

Invalid

Analyzing the above table, if we want something specific to IE 7, then it should be prefixed with * and considering the fact that IE6 will also understand that, we must override that for IE6. We can override that with _ or - property. So here is the solution,

  1. Define a property for Firefox - normal manner
  2. Define the same property for IE7 with * Prefix
  3. Define the complementary property (margin left and margin right) for IE6

Deciding the complementary property needs some amount of logical input. So for example, for a margin issue, this is what we gona have.

  • For Firefox, margin-right: 10px;
  • For IE6, _margin-left: 8px;
  • For IE7, *margin-right: 2px;

That is all we need to do. Now we will see the same in all the brwosers, this is pretty ugly hack, but we dont have a better solution ;)

Internet Explorer Hacks and Tips

Posted in Internet Explorer, WEB 2.0 on April 12, 2007 by Bala

Odd Toolbar Behavior

Did you ever get your Toolbars in IE set just right only to reboot and you lose your settings? Many times when Toolbars are added or removed the Registry entry that controls these settings does not get updated or has become corrupt. You can download a small reg file to reset (to default) and correct this behavior.

  • Download: ResetBrowserToolbar .reg [right-click and select: "Save Target As"
    To use: right-click and select: Merge - Ok the prompt and reboot.

Missing Status Bar

The above reg file will correct this behavior, if your status bar disappears when opening a new IE browser window. However make sure that option is selected - right-click the top Toolbar and select: Status Bar. If you are still having problems verify the below Registry entries exist and are correct:

[HKEY_CURRENT_ USER\Software\ Microsoft\ Internet Explorer\Main]
“Show_StatusBar”=”yes”
“Show_URLinStatusBar”=”yes”

For more on this check out Technical Tempest