The Style in HTML is used to format the html document with required style information specified in head section.
Understand with Example
To set the entire text of a HTML document to one style(e.g., color), we use the following code:Example: Styles in HTML
<head><title>Use of Styles in HTML</title></head>
<font size=10 color="yellow";>
The entire texts in the Body<br> of the Document will be in <br>yellow color
Output is displayed as
When we have to use different style format in a specific paragraph or in a particular line of the document, then we use the following code:
<head><title>Example on the use of inline Styles in HTML</title></head>
<body bgcolor="black" Style="color:Lightblue">
<p style="color: orange">The color of the text in this line is red except <span style="color:yellow">the inline specification</span> made for a particular line or a part of a particular line.</p>
Output shown in the Browser window will be like this-
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: December 3, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles