Home Html Styles in HTML

Related Tutorials


 
 

Share on Google+Share on Google+

Styles in HTML

Advertisement
The Style in HTML is used to format the html document with required style information specified in head section.

Styles in HTML

     

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
<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
</body>
</html>

Output is displayed as

 

Inline Style:

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:

 

<html>
<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>
</body>
</html>


Output shown in the Browser window will be like this- 

 

Download Source

 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 3, 2008

Related Tutorials

Discuss: Styles in HTML   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com