Html Attributes — Free Html Tutorial
Learn Html Attributes in Html with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Html Attributes in Html with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Html Attributes in Html
Attributes provide extra information about HTML elements. Always placed inside the opening tag in name="value" form.
Global attributes work on any element: id (unique on page), class (group elements for CSS), title (tooltip), hidden (hides element), data-* (store custom data).
Some attributes are boolean — just their presence means true: disabled, readonly, required, checked, autoplay, muted.
The id must be unique. The class can be shared. href gives links destinations. src gives media their source.
Html Attributes — Syntax
<tag attribute="value">content</tag> <div id="hero" class="card highlight" title="Tooltip"> <input type="text" required disabled placeholder="Enter name"> <img src="photo.jpg" alt="Description" width="300"> <a href="https://syllab.in" target="_blank" rel="noopener">
Learn Html Attributes step by step with Syllab's free interactive Html tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Html course →