...

View Full Version : Putting IE Fixes Inline



kraftomatic
05-23-2005, 07:11 PM
Hey All,

Quick question. If I have the following CSS code:

#thirdRow {
width: 740px;
height: 125px;
float: left;
margin: 10px 0px 0px 10px;
padding: 0px;
/*border:1px solid #000;*/
}
/* for IE */
* html #thirdRow {margin-left:5px;margin-right:5px;}

How would I enter the IE fix (starting with * html) inline within the div tag itself? I'm trying to do this and can't get it to work.

Thanks.

Bill Posters
05-23-2005, 07:25 PM
Using inline css will only complicate things and clutter up the markup.
Consider using MSIE's conditional comments (http://www.quirksmode.org/css/condcom.html) for your MSIE fixes instead.
You could either embed them…



<!--[if IE]>
<style type="text/css">

#thirdRow {margin-left:5px;margin-right:5px;}

</style>
<![endif]-->

…or throw all the MSIE-specific 'fixes' into their own css file and use conditional comments around the style tags that import it.

e.g.


<!--[if IE]>
<style type="text/css">

@import url(iefixes.css);

</style>
<![endif]-->

kraftomatic
05-23-2005, 07:50 PM
Cool, thanks.

Yeah if I had it my way, everything would be within the stylesheet, but that's not the case. :)

Thanks again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum