class


Class attribute will be used to assign a css class to the control.

Syntax:

<div class="classname"></div>

Example:

<html> <head> <title>HTML Tutorial</title> <style type="text/css"> .divyellow { background-color: Yellow; font-size: 20px; color: Red; height: 100px; padding: 30px; border:dotted 1px green; } </style> </head> <body> <div class="divyellow"> CSS class applied for this div. </div> </body> </html>

Output:

CSS class applied for this div.