HTML Attributes
1.2.3 HTML Attributes
HTML attributes provide additional information about elements. They are placed inside the opening tag of an element and consist of a name-value pair.
Example of an attribute:
<a href="https://www.example.com">Visit Example</a>
hrefis an attribute of the<a>(anchor) element."https://www.example.com"is the value of the attribute.
Common attributes include:
href: Specifies the link's destination (used with<a>).src: Specifies the source of an image or other media (used with<img>,<audio>,<video>).alt: Provides alternative text for images (used with<img>).class: Specifies the class for styling elements.id: Specifies a unique identifier for an element.
Comments
Post a Comment