HTML Attributes
- All HTML elements can include attributes.
- Attributes give extra information about an element or how it should behave.
- They are always written inside the start tag.
- Attributes are usually written as name/value pairs, like this: name="value"
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:
src Attribute
Used with theExample:
<img src="sampleimg.png" alt="HTML Logo">Output: