<style>
<style> tag will be used to define the styles(css classes) whcich can be re used in the page.
Syntax:
<style type="text/css">
.classname
{
define styles here....
}
</style>
Example:
<html>
<head>
<title>HTML Tutorial</title>
<style type="text/css">
.divred
{
background-color: Red;
font-size: 18px;
font-weight: bold;
color: #fff;
height: 100px;
width: 500px;
}
.divgreen
{
background-color: Green;
font-size: 15px;
font-style: italic;
color: #fff;
height: 100px;
width: 300px;
}
</style>
</head>
<body>
<div class="divred">
<q>divred</q> class applied for this div.
</div><br />
<div class="divgreen">
<q>divgreen</q> class applied for this div.
</div>
</body>
</html>
Output:
divredclass applied for this div.
divgreenclass 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