Home Tutorials HTML Tutorial Global Attributes
Global Attributes

Global Attributes


49. Global Attributes

Many HTML elements support global attributes such as id, class, style, title, hidden, and lang. These attributes work across a broad range of elements and are central to practical HTML authoring.

Syntax

<p id="p1" class="note" title="text">Content</p>

Example

<p id="intro" class="highlight" title="Introduction paragraph">Welcome to HTML.</p>

Output

The paragraph appears normally, with metadata attached for styling, scripting, or tooltips.
Example

🏋️ Test Yourself With Exercises

Take our quiz on Global Attributes to test your knowledge.

Browse Quizzes »