HTML Attributes


href Attribute

Commonly used for the tag which defines a hyperlink. The href attribute specifies the URL of the page the link goes to:

Example:

<p><a href="https://www.w3schools.com">Visit ByteAcademy</a></p>

Output:

Visit ByteAcademy

src Attribute

Used with the tag to specify the path or URL of the image file that will be displayed on the web page.

Example:

<img src="sampleimg.png" alt="HTML Logo">

Output:

HTML Logo

HTML Logo