Elements

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 :

Practice Exercises

Task 1: Create an HTML page with a heading, a paragraph, and a link pointing to 'https://aitaurangabad.com' using the href attribute.

Goal: Practice defining link destinations using the href attribute.
💡 Hint: Place href="https://aitaurangabad.com" inside the opening <a> tag.
💡 Show Solution
<html>
  <body>
    <h2>Academy Website Link</h2>
    <p>You can visit the official website of the Academy of Information Technology (AIT) by clicking the link below:</p>
    <a href="https://aitaurangabad.com">Academy of Information Technology (AIT)</a>
  </body>
</html>
Output :

Academy Website Link

You can visit the official website of the Academy of Information Technology (AIT) by clicking the link below:

Academy of Information Technology (AIT)
Explanation: The href attribute provides additional information inside the start tag to specify the destination URL for a hyperlink.