Current Assignment(s)
A5: Multimedia
Due: Recommended by Monday, 5.28
Due: Recommended by Monday, 5.28
Clarity and Structure with Classes
In addition to the ID attribute, another attribute that is valid in every HTML element is the class attribute.
Like the ID attribute, the class attribute is an identifier and selector value for HTML elements. The class attribute groups similar types of elements together by using the same unique name value. This allows for easy styling of these elements with same CSS code.
HTML
<div id="a-unique-id" class="a-unique-class-name">
The class attribute also serves to visually inform developers that certain elements content similar types of content, or serve a similar function on a page.
- Previous
- Next