.

Saturday, March 27, 2010

Styles

Posted by devlevis | Saturday, March 27, 2010 | Category: , , , , , |

Styles are a relatively new element for HTML, but they have revolutionized how
HTML documents are coded and rendered. Styles are the main basis behind the
“extensible” in XHTML—they allow Web authors to create new styles to present their
content in a variety of custom, but consistent formats.
At their root, styles are simply an aggregation of display attributes, combined to
achieve a particular result. Those familiar with styles in word processing will have
little trouble understanding HTML styles.
For example, suppose you needed to highlight particular text in a document that
needed to be deleted. The text needs to be displayed in red and as strikethrough.
You could surround each section of text with and tags. However, that
approach has two distinct disadvantages:
✦ The tag has been deprecated and should not be used.
✦ If you later change your mind about the color or decoration (strikethrough),
you would have to find and change each set of tags.
Instead, define a style for the elements that contains the desired text attributes. The
following HTML code snippet defines such a style and uses it to highlight a sentence
later in the document

Currently have 0 comments:


Leave a Reply