CSS Hack for IE(7)
Posted By Mary Dane on August 22, 2008
CSS has always been a hell of a big deal to me (I guess every user’s) for it’s long-been-known cross browser incompatibility tendency. I can still remember how I have to be as patient as I could to keep up on the first few months of disalienating myself to it. Because of my need to design freely without compromising any of Firefox and IE (as these 2 browsers are the ones with a higher percentages of users), I always had to search the web for easiest (or at least one that wouldn’t take up too much time to do) ways on how to eradicate design flaws. I don’t really have that much problem with Firefox though–I guess it’s the most tolerant browser ever. Internet Explorer is quite a dud when it comes to CSS.
Part of what I learned was this simple CSS hack for IE (particularly IE6) which eliminates differences with Firefox. It’s the “* html” thing which really works so far fine for me. I use it in positioning div’s as sometimes what appears on Firefox doesn’t appear similar to IE. For example, if you have this CSS code for a certain div,
#header{
width:739px;
height:220px;
position:relative;
top:5px;
margin:0 auto;
}
the 5px top position may not be enough or too much on IE as to how it is on Firefox. So I always use similar to the following code to save my design,
* html #header{
top:8px;
}
I always knew this hack would sooner or later have changes and it turned out right when I started using IE7. I was back again on a great deal with IE’s CSS glitch in version 7. But fortunately didn’t took me too long to find the new hack. I found out it is now “* + html”.
* + html #header{
top:8px;
}
That is the equivalent code for IE7 of the above code (which is for IE6). There are instances though to which this hack (or any CSS hack at all) is not that necessary like those designs that don’t need tight-knit positioning of elements. But for some instances, including having a knit-picky boss, I bet it is that much.;)
More Web Design Help and Tutorials here
wow nice tips you got here (^_^) thanks eto din ang problema ko eh
Aice Nice Conceptss last blog post..Kadayawan in Victoria Plaza
Thanks for this information it really helps a lot to me.