Development| HTML| JavaScript| Questions?

Hot Searches
struts-config.xml  web.xml  Java date format  read/write text file using javascript  ArrayList  Insert Data into Database Using Hibernat  create text file using java  insert data to text file using java  Visual Basic Date and Time Display the t  Create table and insert data by sql quer 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

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

 

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

2 comments so far (
post your own) View All Comments Latest 10 Comments:

html>
<head><title>Use of Styles in HTML</title></head>
<body Style color="Lightyellow">
The entire texts in the Body<br> of the Document will be in <br>Lightyellow color
</body>
</html>

Posted by harish on Thursday, 12.4.08 @ 01:02am | #82358

<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>

Posted by harish on Thursday, 12.4.08 @ 01:01am | #82357

Tell A Friend
Your Friend Name

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.