HTML and CSS Reference
In-Depth Information
If you want to target IE6 and older, you might use the * html hack, which
to most browsers will not apply to any elements because there is no
element above the root <html> tag, but IE got that wrong until version 7.
div.column {
width: 200px;
* html div.column {
width: 198px;
You can find a compendium of CSS hacks and their dangers on
( ).
The danger in using hacks of any nature is that it is impossible to control
how future browsers behave in the same circumstance. Will a future
Safari version parse your hack the same way but no longer need the
changed value you're feeding it? You're leveraging incomplete support for
specifications (or more directly, software bugs), and therefore you're at
the mercy of what fixes developers make over time.
Microsoft Conditional Comments
If you find you need to give a good deal of specialized code to Internet
Explorer or that you don't want to mix and maintain selectors or syntax
hacks, you can use conditional comments (
Conditional_comment ). Using standard HTML comments (because non-IE
browsers will ignore anything inside of them) and a few extra characters
that tell IE to pay attention, you can feed IE or some specific version of IE
a link to a style sheet with extra rules.
<!-- [if IE]>
<link type=”stylesheet” src=”/css/all_ie.css”>
<![endif] -->
(continues on next page)
Search WWH ::

Custom Search