At 11:27 AM +1000 10/19/05, Peter Williams wrote:
 > From: css man

 Does anyone know of any tutorials, reference or other sites
 that focus on inline CSS?

CSS isn't different when it is applied inline, in a style
element, or in an external stylesheet.

It isn't fundamentally different, but I can think of at least two common "gotchas" related to inline CSS:

1. Inline CSS is always of the highest specificity, applying in preference to anything in a style element or external style sheet. [1] 2. Because they are parts of the selector and are not style properties, pseudo-classes and pseudo-elements cannot be used in a style attribute. Thus you cannot apply, for example, :hover or :visited styles on an element (not even on an anchor) from within a style attribute, nor can you use generated content. Dynamic effects cannot be achieved through inline styling alone.

Although it does have its uses, make sure you know why you want to use inline styles. As Peter suggests, placing the CSS inline does remove a good deal of the flexibility and ease of maintenance that makes CSS such a powerful and valuable tool.

1. <http://www.w3.org/TR/CSS21/cascade.html#specificity>


Good luck,
--

-Adam Kuehn
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to