PDA

View Full Version : Inline Styles: Are they Deprecated?


Badman3k
03-10-2005, 12:48 PM
I was told recently that the following has been deprecated in XHTML, but i can't seem to find any information to back this up. I've tried browsing the W3C site, but to no avail.

Could someone tell me for whether it has been deprecated or not please.

An example of the code:

<div id="somelayer" style="background-color: #FF00FF;">
This is some text within the layer
</div>

Many thanks in advance,

liorean
03-10-2005, 01:50 PM
No, it isn't deprecated. At least not in XHTML1. XHTML2 has it but with this clause:Note: use of the style attribute is strongly discouraged in favor of the style element and external style sheets. In addition, content developers are advised to avoid use of the style attribute on content intended for use on small devices, since those devices may not support the use of in-line styles.That clause goes equally well for XHTML1 or even HTML4.