HOME | basics of HTML | basics of PHP | neobux | onbux | readbud | templates |
| |||||||||||||||||||||||
StylesCSS is used to style HTML elements.
Styling HTML with CSSCSS was introduced together with HTML 4, to provide a better way to style HTML elements. CSS can be added to HTML in the following ways:
Using the HTML Style AttributeIt is time consuming and not very practical to style HTML elements using the style attribute. The preferred way to add CSS to HTML, is to put CSS syntax in separate CSS files. However, in this HTML tutorial we will introduce you to CSS using the style attribute. This is done to simplify the examples. It also makes it easier for you to edit the code and try it yourself. You can learn everything about CSS in our CSS Tutorial. HTML Style Example - Background ColorThe background-color property defines the background color for an element:
The background-color property makes the "old" bgcolor attribute obsolete. Try it yourself: Background color the old way HTML Style Example - Font, Color and SizeThe font-family, color, and font-size properties defines the font, color, and size of the text in an element:
HTML Style Example - Text AlignmentThe text-align property specifies the horizontal alignment of text in an element:
The text-align property makes the old <center> tag obsolete. Try it yourself: Centered heading the old way Deprecated Tags and AttributesIn HTML 4, several tags and attributes were deprecated. Deprecated means that they will not be supported in future versions of HTML. The message is clear: Avoid using deprecated tags and attributes! These tags and attributes should be avoided:
For all of the above: Use styles instead! |
|||||||||||||||||||||||
© 2011 d4download.orgfree, All Rights Reserved.
Design created by diljith d4download.orgfree.com veriosn 2.0
HOME | basics of HTML | basics of PHP | neobux | onbux | readbud | templates |