Forum Moderators: not2easy

Message Too Old, No Replies

Different CSS element for IE6

         

terrybarnes

10:28 am on Sep 19, 2008 (gmt 0)

10+ Year Member



Hi. Bare with me here as I'm a little rusty with the old CSS! I have just developed a small site but there's a couple of issues with IE6 (no surprise there then). Therefore I would like to specify something different in the CSS when viewed in IE6.

I have this, which is working except for IE6:

.ui-tabs-nav li { width: 102px; float: left; margin: 0 0 0 2px;

But need to change it to this for IE6:

.ui-tabs-nav li { float: left; min-width: 102px; margin: 0 0 0 2px;

Should I specify IE6 to see a different stylesheet or just a different element. If so, how do I do this as I've completely forgotten.

Thanks in advance for any help.

swa66

10:41 am on Sep 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Conditional comments will solve all your IE trouble.

You specify the normal stuff all browsers but IE use in the regular stylesheet.

Next you add what you need for each individual version of IE to a separate (loaded over the top of the normal one) changing what needs to be changed to get IE happy. You can do so without different versions of IE seeing their troubled sibling's needs, and you can keep the trouble away from the standard compliant browsers as well avoiding problems there.


<link rel="stylesheet" type="text/css" href="/style.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/ie6.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="/ie7.css" />
<![endif]-->

The "old school" alternative were parsing hacks, but they can backfire seriously and should be avoided IMHO

terrybarnes

10:46 am on Sep 19, 2008 (gmt 0)

10+ Year Member



Fantastic - very much appreciated.