class Attribute
class attribute
The class attribute specifies one or more class names for an element. It is mostly used for CSS styling but some developers use it in JavaScript.
Attribute Explanation:-
Value | Description |
---|---|
classname | Specifies one or more class names for an element. To specify multiple classes, separate the class names with a space.
|
Rules form naming classes are:-
- Must begin with a letter i.e, A-Z or a-z
- Can be followed by: letters (A-Za-z), digits (0-9), hyphens ("-"), and underscores ("_")
Syntax:-
Its syntax is:- < element class="classname" >
Code Explanation
All Tutorials related to HTML Global Attributes
accesskey Attribute
class Attribute
contenteditable Attribute
data-* Attributes
dir Attribute
draggable Attributes
hidden Attribute
id Attribute
lang Attribute
spellcheck Attribute
style Attribute
tabindex Attribute
title Attribute
translate Attribute