![]() |
"style=" attribute![]() |
![]() |
Note: If your browser supports CSS1, the style= attributes below will be crimson.
See also: the <style> tag.
There are several ways to implement Cascading Style Sheets. The style= attribute is one of them.
In essence the tag is declared and then, using the style= attribute, is modified by properties and values. These are stipulated as arguments to the "style=" attribute.
Example:
The background of this paragraph should be lime.
The style attribute can take any property/value combination that can be used in any style definition.
The style attribute will affect only those properties that are previously defined and only for the tag to which the attribute is attached.
Example:
This is the paragraph that has the text colour defined as gray. The emphasis tag resets it to crimson. However, the <big> tag inherits the setting.
<p style=background-color: 'lime'; color: '#808080'>This is the paragraph that has the text colour defined as gray. The <em style=color:'#dc143c'>emphasis</em> tag resets it to crimson. However, the <big> tag inherits the setting.</em>