HTML and CSS Reference
In-Depth Information
Yo u c a in a l s o u s e gt and gte (“greater than” and “greater than or equal to”) in
the same way, but you will be much less likely to use these. Most likely, you'll use
IE conditional comments to:
Serve scripting only to specific IE versions, either to provide alternative
mechanisms that will work in IE or to build in support for HTML and CSS
features that don't have native support.
Serve CSS to fix IE-specific CSS bugs that threaten to make your lovingly
crafted layouts crumble. The most obvious fixes that spring to mind are
serving older IE versions different width and height values to compensate
from the broken box model and giving various layout features hasLayout
to make those features behave properly in IE.
Display abusive messages only to users of older IE versions while bullying
them into upgrading their browser.
Bruce Lawson has written a great article that expands this topic further called
“Supporting IE with conditional comments” (
supporting-ie-with-conditional-comments). There is also an article on MSDN
called “About Conditional Comments” (
ms537512.aspx) that contains some pretty dreadful outdated web development
ideas but provides a good reference for all of the IE conditional syntax available.
NOTE: IE10 completely ignores conditional comments, so you can't
use them to direct code only to IE10. This isn't as bad as it sounds:
IE10 has really good standards support, worthy of a modern browser,
so chances are you wouldn't need conditional comments anyway.
After reading this chapter, you are up to speed on your markup structures and have
built a toolkit you can rely on. Now you can stretch and relax a bit.
When you're ready to continue your work and start looking into CSS3 enhance-
ments for text and fonts, turn the page when you hear the tone. (If you've not bought
the interactive version of the topic, invent your own tone and hum it to yourself.)
Search WWH ::

Custom Search