HTML Classes

The HTML class attribute is used to create a single or multiple classes for HTML elements.

This class name can be used by javascript and css to attempt certain tasks for HTML elements with the selected class name.


<!DOCTYPE html>
			color: yellow;
			background-color: red; }
<h1 class="myclass">This is first heading</h1>
<h2 class="myclass">This is Second heading</h2>
<h3 class="myclass">This is third heading</h3>
<h4 class="myclass">This is fourth heading</h4>

Click on the "Run This Code" button to see how it works.


Welcome HTML Getting Started HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Links HTML Styles HTML Text Formatting HTML Tables HTML Images HTML Forms HTML Lists HTML Iframes HTML Comments HTML CSS HTML Colors HTML Classes HTML Id HTML javascript HTML Filepaths

HTML Advanced

HTML Doctypes HTML Validation HTML Validation HTML URL HTML URL Encode HTML URL Entities HTML Layout HTML Head HTML Meta HTML Scripts HTML Tags

HTML Media

HTML Media HTML Audio HTML Video HTML Plug-ins HTML Youtube

HTML Graphics