Style Sheet Tips and Tricks
The following Cascading Style Sheet tips and tricks are courtesy of Eric Meyer (author of O’Reilly’s Cascading Style Sheets: The Definitive Guide).
Style Sheet MIME Types
Some
authors have reported trouble with
gettting their ISPs to correctly serve up CSS files. Apparently, with
some Web servers, .css is mapped to the
MIME-type x-application/css, or “Continuous
Slide Show,” instead of the MIME-type
text/css. The style sheet gets mangled into
something else. If you find you’re having this problem,
you’ll need to contact your ISP and explain the problem.
Because .css is now an IANA-registered
MIME-type, service providers really have no excuse for not supporting
it for style sheets. If they refuse to fix it, and style sheets are a
necessary part of your site, you may have to consider switching ISPs.
Specifying Text Size in Pixels
One of the great frustrations in designing web pages is that fonts are rendered so differently from platform to platform, especially with regard to point size. The same point size will be rendered much larger on a PC than on a Mac, making it difficult to anticipate how much type will fit on the page. (See “Why Specifying Type is Problematic” in Chapter 3.)
Style sheets introduce the ability to specify type size in pixels. This translates better across platforms because the size of the type stays fixed in relation to the other elements (like graphics) on the page. The result is more predictable page layouts.
Most web developers ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access