HTML attributes are extra bits of info you add inside an HTML tag to change how that element behaves or looks.
Think of a tag like noun, and attributes as the adjective
- instructions for it.
The most used HTML attributes and what they do
Core/Global attributes
Work on almost every element
A. id="uniqueName": Gives the element a unique name. Used for CSS, JS, and linking. id must be unique on the page
B. class="name1 name2": Groups element for styling with CSS or selecting with JS
C. lang="en": Declares the language of the content
Top comments (0)