HTML Attributes

By | January 1, 2020

All HTML elements have Attributes. These provide additional information about HTML elements. It has a start tag which is the name of Attributes and in double quotes its value is given. Example:-

<element attribute_name=”value”>Content</element>

In the above example, the three HTML elements are <h1>, <a> and <img>.

title is attribute in <h1> while “This is h1 Heading” is value of attribute.

href is attribute in <a> while “https://learnhtmlcoding.com/” is value of attribute.

src is attribute in <img> while “tamplate.jpg” is value of attribute. Similarly

<img> -tag Name,

alt = attributes,

“tamplate” = value.

Output:-

lang attribute:-

<html lang=”en”> in HTML defines the language of all documents of HTML.

In HTML attribute you can use both single quote and double quotes both are correct.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *