HTML TutorialLesson 5Free preview
HTML Attributes
This lesson is part of HTML · All levels
Summary
An attribute is the additional information provided to an HTML tag to set the way an element works or appears. Attributes are written in the opening tag with the name="values" pattern, e.g. src and alt on <img>. Global attributes like id and class can be used on almost any element.
Key points
- Attributes written in the opening tag with the name="value" pattern
- Attributes must be double-quoted to be secure.
- <img> uses src for image source and alt for alternative text
- Global attributes like id, class, and style can be used in many elements.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.