Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS if statements... is it right?

I'm new with the conditional CSS. My question is, is it right to use it for dealing with cross-browsers issues?

For example:

#header
{
    [if IE 7] width: 600px;
    [if Webkit] width:300px;    
}

Editor's note: OP is most likely using this: http://www.conditional-css.com/

like image 479
BorisD Avatar asked May 23 '11 18:05

BorisD


1 Answers

Use conditional statements for the actual CSS files (or classes) but on the html.

Like this for example:

<!--[if lte IE 6]>
<link href="css/layoutIE6.css" rel="stylesheet" type="text/css" />
<![endif]-->

This is written on the html file, not the CSS file!

The format you posted I think doesn't actually work and I bet it doesn't validate so it is not standard.

like image 56
jackJoe Avatar answered Sep 23 '22 06:09

jackJoe