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.
Useful Tools
Online Code Editor and Compiler
HTML Minifier
Online HTML Compiler/Preivew
Word Count Tool
Replace Text/Word tool
Latest Blogs
How to check if a canvas is empty or blank
Maintain div or panel scroll position after postback in asp.net update panel
Draggable button using jquery ui
Get total number of tables, views, stored procedures and functions count and names in sql server
JavaScript function to get date in mmddyyyy hhmmss ampm forma