View Full Version : IE 7.0 specific CSS tags
torontonian
01-12-2007, 04:21 PM
I am looking for a way to write IE 7.0 specific CSS tags.
I have some tags in my CSS file that are redefined specifically for IE 6.0 using the following syntax:
* html #mainmenu { padding-top: 32px;}
The problem is, several of these CSS issues have been resolved in IE 7.0 (as well as there being new CSS issues) so I'd like an IE 7.0 equivalent of the * html syntax in order to overwrite this tag for IE 7.0.
Any ideas would be very much appreciated.
Thanks.
Hacks for IE have been unnecessary for a while. Use conditional comments instead:
<!--[if IE lt 7]>
<style type="text/css">
#mainmenu {
padding-top: 32px;
}
</style>
<![endif]-->
<!--[if IE 7]>
<style type="text/css">
#mainmenu {
/* IE7-specific stuff. */
}
</style>
<![endif]-->
torontonian
01-12-2007, 05:04 PM
Thanks for the quick reply. This works great. The only thing is, it doesn't work in vBulletin.
Do you know a way around this?
Thanks again.
What do you mean by not working? And, in vBulletin how? Embedded in the page? Does vBulletin mangle it somehow?
torontonian
01-15-2007, 03:25 AM
When I add the IE7 specific code to the "headerinclude" section of the vBulletin style, it completely ignores it. It simply has no effect.
torontonian
01-16-2007, 02:27 AM
Unfortunately I cannot show the site yet. Are you aware of any issues when of having IE 7 specific tags in vBulletin?
Thanks again for your help.
jscheuer1
01-16-2007, 05:39 AM
I have no idea if this will help but, if vBull is mangling it, this might:
<!--[if gte IE 7]>
<style type="text/css">
/*<![CDATA[*/
styles go here
/*]]>*/
</style>
<![endif]-->
torontonian
01-16-2007, 03:54 PM
Thanks for your help. I eventually found the way to do this. vBulletin has conditions which you can use like this:
<if condition="is_browser('ie', '7')">
<style type="text/css">
#mymenu { padding-top: 10px;}
</style>
</if>
This solved the problem nicely :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.