...

View Full Version : CSS (IE/FF)top property problem



lokeshshettyk
11-13-2008, 11:20 AM
Hi,
Below is my css for a dropdown i created. everything works fine except for the top property. I want the "top" to be the same for IE 6 & 7 and "top: 0" for FF. But FF also takes 1.4em :(. Can someone help me with this please!


/* For IE 7 */
html>body .postNav .shareDD {
top: 1.4em;
}
/* for IE 6 */
* html .postNav .shareDD {
top: 1.4em;
}

/* for FF */
.postNav .shareDD {
top: 0em;
}

abduraooft
11-13-2008, 11:30 AM
html>body .postNav .shareDD {
top: 1.4em;
} The above one is more specific than
.postNav .shareDD {
top: 0em;
} and FF also recognise the child selector > (neglecting your command inside the comment :p ).
Thus the first one would override the last in FF as per CSS specificity (http://www.htmldog.com/guides/cssadvanced/specificity/).

lokeshshettyk
11-13-2008, 11:39 AM
Thanks! and I'm confused. What would be the css then to distinguish between IE6, 7 and FF for the below given segment?

abduraooft
11-13-2008, 12:06 PM
You could use conditional comments (http://www.quirksmode.org/css/condcom.html) to write some specific tags, but normally there won't be a case where we need to handle IE6 and IE7 separately for the top property. There might be some other issue with your code.

lokeshshettyk
11-13-2008, 12:36 PM
That's not true in my scenario (at least with this). Thanks anyway:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum