style Attribute (deprecated)style Attributestyle is a Common Attribute from the
Core Attribute Collection
and is of Type CDATA.
It may be used on most elements in the Element Index - all except: base, head, html, meta, param, script, style, title.
NOTE: The Style Attribute Module, which contains only the
style attribute,
is deprecated in XHTML 1.1.
This attribute allows a set of style declarations to be applied to an individual XHTML element within the XHTML itself,
rather than by using selectors in an external style sheet or a style element.
Its use is now deprecated.
If you do use the style attribute in your document, however, you should indicate the
MIME type of the style declarations (typically "text/css") in a Content-Style-Type
HTTP header.
Example (using CSS styles):
<div style="background-color:#eee; color:#900; border:1px solid #00f; padding:0.5em">
This div has a grey background, red text, a blue border and 0.5em of padding all around.
</div>
This renders as: