Prev | Current Page 46 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"


Inline CSS is more limited than internal or external style sheets. It??™s not possible
to specify a media type, so style attributes will apply for all media types. Also, you
can??™t specify inline CSS rules for pseudo-classes (p. 80) or pseudo-elements (p. 106).
If you use inline CSS, the HTML specification12 states that you must declare the
style language. You can do so using a HTTP header or an equivalent element:

12 http://www.w3.org/TR/html401/present/styles.html#default-style
In reality, browsers don??™t care because the HTML specification also states that the
style content type defaults to "text/css" if it??™s not specified in a element
or a Content-Style-Type HTTP header.
Yes, it may seem that the statements ???you must declare the style language??? and ???the
style content type defaults to "text/css" if not specified??? are mutually exclusive,
but the intent was only to provide a safety net. The specification recommends that
authoring tools automatically generate the style sheet language information in order
to avoid forcing user agents to rely on the default value.


Pages:
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58