Style Rules
Embedding a Style Sheets
External Style Sheets
Importing a Style Sheets
Styles Inline
Class
ID
SPAN and DIV
Quick Reference Table
HTML Tutorial
Databases and ASP
   


Styles Inline

Styles can be inserted inline using the STYLE attribute. The STYLE attribute may be applied to the body and any BODY element. For example:

<HTML>
<HEAD>
<TITLE>Styles inline</TITLE>
</HEAD>
<BODY>
<H4 STYLE="color: #FF0000">Style Tricks</H4>
<p><a STYLE="color: #FF9900; text-decoration: none; font-size: 14pt" href="http://www.w3.org">The world Wide Web Consortium</a></P>
</BODY>
</HTML>

Click here to see the result:

Note

The disadvantage of using inline style is that you have to add the inline style code every time you want to use it. However it could be handy sometimes if your HTML page is linked to an external style sheets and you would like to overide it. For example:- The following inline style code will overide the external style sheets.

<HTML>
<HEAD>
<TITLE>Styles Inline</TITLE>
<LINK REL="stylesheet" HREF="stylelink.css" TYPE="text/css">
</HEAD>
<BODY>
<H4 STYLE="color: #FF0000">Style Tricks</H4>
<p><a STYLE="color: #FF9900; text-decoration: none; font-size: 14pt" href="http://www.w3.org">The world Wide Web Consortium</a></P>
</BODY>
</HTML>