View Full Version : selectors that don't exist?

02-21-2008, 04:41 PM
I inheritted a system that several people had worked on. The resulting CSS was a bit of a surprise. In included several selector or variants that I don't recognize.

Does anyone know what these selectors are?

_height /**/:

02-21-2008, 04:49 PM
http://www.codingforums.com/showthread.php?t=121377 :)

02-21-2008, 04:51 PM
_height property
Posted: Wed, 2004-03-31 19:57


Adding an underscore in front of a style attribute is an IE hack, so before you remove it, are you sure you want to?


From Google.


02-21-2008, 06:00 PM
Very interesting read, including the embedded links in that thread.

As it seems geared to IE5, you would think I might remove it. But I don't know what my users (anyone in the state of Illinios) are using so I'll just keep it and add a comment so the next guy won't be starting from zero.

02-21-2008, 06:02 PM
If it ("_") is purely an IE5 hack, then it is interesting, but not something that I will develop with. I'll keep it in there as it already exists, but comment it so the next guy doesn't start from zero.

02-21-2008, 06:04 PM
Its invalid CSS. You should use conditional comments (http://quirksmode.org/css/condcom.html) for specific versions of IE.

02-21-2008, 06:17 PM
It seems to me that the link says that it will only work in the HTML and specifically not in the CSS. That would suggest that two different CSS pages would be conditionally loaded on the page with slight variations to accomodate IE5.

While I hate duplicating pages like this, if it is needed then I will do it. The question becomes is it needed. Is it worth the duplication and complexity to accomodate IE5 in your opinion?

02-21-2008, 06:19 PM
You only put what needs to be fixed in the IE stylesheet not the entire stylesheet. If you are trying to clean up the code and make it valid then yeah do it unless you don't think your client cares about IE5 then don't or much less validation but thats kind of your job. For example

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

02-21-2008, 06:23 PM
I think I see. Put the first CSS. Then conditionally put the IE5 fixes using the conditional statements. That makes more sense than the way I was thinking of.

Frank mentioned that "_" was a similar hack. You don't happen to have a thread detailing that like the excellent one on "\" do you?

[edit - found it at http://codingforums.com/archive/index.php?t-72058.html]