Sunday, January 19, 2014

Types - User Defined

Here user defines his own style and uses it anywhere he wants.

Code:
<head>
<style>
.mystyle1
{
color: green;
background-color: orange;
}
</style>
</head>

The names used for user defined styles should not belong to any html tag. We set the style for the tag using the attribute "class".

Example1:

<font
 class=mystyle1> MY STYLE </font>

Result: 

MY STYLE
 

Example2:

<a href="index.php"
 class=mystyle1> MY STYLE </a>

Result: