HTML and CSS Reference
In-Depth Information
You can learn more about this at paulirish.com/2010/the-protocol-
relative-url/ .
Using conditional comments
Historically, IE6, IE7, and IE8 have been browsers with the most bugs and inconsist-
ent rendering of styles. There are many ways to serve styles to IE versions 8 and
below, here are a few.
Browser style hacks
The most prevalent technique is to use hacks in CSS style rules that target only one
browser.
For IE6 and below, use the following code snippet:
* html #uno { color: red }
For IE7, use the following code snippet:
*:first-child+html #dos { color: red }
For IE8, use the following code snippet:
@media \0screen {
#tres { color: red }
}
There are more hacks that target two or more browsers (or exclude two or more
browsers) all listed in the post at paulirish.com/2009/browser-specific-
css-hacks/ .
The problem with these hacks is that first they exploit holes in the browser's parsing
technology. If browsers fix these parsing errors then they may not work. Luckily, we
do not have to fear about this for older browsers such as IE6 and IE7.
Search WWH ::




Custom Search