CSS Travesties
Those of us who were around and hard at work in the mid-1990s knew about CSS and prayed fervently for it to be implemented sooner and more effectively than it was. To make a long story extremely short, programming for the Web in the late â90s sucked because it wasnât.
Ten years on from the ultimate peak of âirrational exuberance,â we now have better CSS. Still, itâs not always so good at coping with the requirements of the contemporary Web. Its truly rough patches are described in the following sections.
@-Rules
As design elements go, @
-rules
are elegant. They provide an additional mechanism for narrowing scope
via the cascade, which is awfully elegant on its own.
Unfortunately, theyâre poorly supported. Consider:
@import
rules might or might not be applied by a given browser, depending on how theyâre written and where theyâre located in the source order of a document or stylesheet.@import
and@media
rules can take on additional, vendor-defined, arbitrary attributes that usually want for clear documentation.Support for alternative media properties leaves a great deal to be desired, as discussed in Chapter 3.
- Verdict
When
@
-rules work, theyâre great, but when they donât, theyâ¦donât. Some of the features discussed here might pop serendipitously into your psyche and save you several hours of labor during a death march, but itâs very unlikely that@
-rules will ever be among them.
Computed Values and Rounding Differences
Every visual display medium has ...
Get HTML & CSS: The Good Parts now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.