Home Html Styles in HTML



Styles in HTML
Posted on: December 3, 2008 at 12:00 AM
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

 

Related Tags for Styles in HTML:
htmlcormuiformstyleiosedformatifforiewithtorequireinformationcieitdocsectionusepeinmlrminfomheadntadspecmedosspathtmisirinfeassthstatiinforminformatono


More Tutorials from this section

Ask Questions?    Discuss: Styles in HTML   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.