We are only touching the basics of CSS in this tutorial; the CSS tutorial is much more detailed.


Style Attribute

The style attribute has the following syntax:

style="property:value;"

Some examples of styling attributes:

 Attribute:  Property:  Value:  Result:
style=" color: green;" Makes the text green.
style=" background-color: yellow;" Makes the background color yellow.
style=" font-family: verdana;" Displays text in the Verdana font.
style=" font-size: 24px;" Makes the font 24 pixels high.
style=" text-align: center;" Centers the text.

The property is a CSS property. The value is a CSS value.


Note: The property and value are always inclosed in quotes.

Back button Table of Contents Next button