HTML TutorialLesson 23Free preview
HTML Classes
This lesson is part of HTML · All levels
Summary
The class attribute names the grouping on an element so that it can be given the same CSS style repeatedly. A class can be used by many elements, and an element can also hold several classes at once. Classes are written in CSS with a dot mark before the name, for example .intro.
Key points
- Class names a group of elements to be given a common style
- One element may have several classes separated by spaces
- Written with the attributes class="name"
- Selected in CSS with a dot mark, for example: .judul
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.