Attributes

All HTML elements can have attributes.
Attributes provide additional information about an element.
They are always specified in the start tag and usually come in name/value pairs.

Basic Syntax

<tagname attribute_name="value">Content</tagname>

Example

<a href="https://www.example.com">Visit Example</a>

Attribute Breakdown

Attribute Purpose Example
href Specifies the URL for a link <a href="https://example.com">
src Specifies the path of an image <img src="image.jpg">
alt Provides alternate text for an image <img alt="My Image">

href Attribute

Output :