id class style and title
Apply core global attributes to any HTML element.
Global Attributes
Global attributes can be applied to any HTML element:
id— unique identifierclass— one or more CSS classesstyle— inline CSStitle— tooltip text- And many more: lang, hidden, tabindex, data-*...
The id Attribute
The id attribute assigns a unique identifier to an element:
<h2 id="installation">Installation Guide</h2>
<form id="signup-form">...</form>
<div id="hero-banner">...</div>
<!-- Rules:
- Must be unique per page
- No spaces
- Use hyphens: user-profile
- Case-sensitive: #hero ≠ #Hero
-->All lessons in this course
- id class style and title
- The hidden Attribute
- tabindex and accesskey
- Custom Data Attributes data-*