Forum Moderators: not2easy

Message Too Old, No Replies

How do I write a conditional statement for IE6 and lower?

         

boonedawg

2:25 am on Apr 18, 2006 (gmt 0)

10+ Year Member



I am currently only using the box model hack for IE explorer. I would like to know how to write a conditional statement for IE6 and lower to handle this CSS hack. I don't where to begin to do this. I would also like to know how to call up a IE style sheet to handle this box model hack.

This is the code that I am using for my site container:

#container {
width: 970px;
\width: 990px;
w\idth: 970px;
background: #ffffff;
text-align: left;
padding: 0;
margin: 0;
voice-family: "\"}\"";
voice-family: inherit;
width: 970px;
}
html>body #container {
width: 970px;
}

And this is the hack I am using for all other box models:

#header {
width: 970px;
padding: 0;
margin: 0;
voice-family: "\"}\"";
voice-family: inherit;
width: 970px;
}

Any help in this subject would be greatly appreciated. Thanks in advance.

boonedawg

Setek

2:28 am on Apr 18, 2006 (gmt 0)

10+ Year Member



You can research conditional comments:
[msdn.microsoft.com...]

Basically, in your head, where you link your stylesheets, make a separate stylesheet for IE, e.g.:

<head>
<link rel="stylesheet" type="text/css" media="screen" href="includes/stylesheet.css" />
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" media="screen" href="/includes/ie_override.css" /><![endif]-->
</head>

Like that :)

boonedawg

4:26 am on Apr 18, 2006 (gmt 0)

10+ Year Member



Thanks Setek,

That was very helpful.

boonedawg

boonedawg

6:12 am on Apr 18, 2006 (gmt 0)

10+ Year Member



I was wondering how to write a conditional statement for the "be nice to Opera 5" hack? I know it's to help out UAs which support CSS2 selectors and the CSS box model, but have the same parsing bug as IE5.x/Windows. Would I have to make an additional stylesheet for the conditional statement to call? This is the hack that I am talking about:

html>body #container {
width:970px;
}

boonedawg