Attributes: Adding More Details
HTML tags can have attributes that provide additional information. Some commonly used attributes include:
id
: A unique identifier for an element.- Example:
<div id="header">This is the header</div>
- Example:
class
: Used to classify multiple elements.- Example:
<p class="intro">This is an introductory paragraph.</p>
- Example:
src
: Specifies the source of an image.- Example:
<img src="logo.png" alt="Company Logo">
- Example:
href
: Specifies the destination URL of a link.- Example:
<a href="https://www.example.com">Go to Example</a>
- Example: