How to add Simple CSS Class in Style Sheet

CSS

In CSS File you can add as many class as you want to add.
We will show you a simple example to add a new class in your style and in html file.
Please check the below Example which will add a new class with width and color to the content of the class:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>How to add Simple CSS Class in Style Sheet</title>
</head>
<body>
<div class="myclassname">
Hello This is the Div Content.
</div>
.myclassname
{
//Here you can write your own styles
float:left;
width:200px;
color:red;
}
</body>
</html>

Comments are closed.