Example:
HTML
<!DOCTYPE html>
<html>
<head>
<style>
h1.intro {
color: blue;
text-align: center;
}
.important {
background-color: yellow;
}
</style>
</head>
<body>
<h1 class="intro important">Header 1</h1>
<p>A paragraph.</p>
</body>
</html>
How to Use of the class attribute in an HTML document - | HTML Global Attributes |
How to add Add multiple classes to one HTML element | HTML Global Attributes |
How to use JavaScript to add a yellow background color to the first element with class="example" (index 0) | HTML Global Attributes |
How to use JavaScript to add the "mystyle" class to an element with id="myDIV" | HTML Global Attributes |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Global Attributes |
Uploaded by: | Admin |