Attributes of HTML Tags

Explanation of the Attributes of HTML Tags

What are attributes in HTML?

HTML attributes provide additional information to an element, which defines the behavior of that element.

Each element or tag can have one or more than one attributes. And in HTML, there are a lot of attributes for all elements, some attributes are only for specific elements or element, and some are for all.

How to add HTML attributes to a tag?

Attributes are always specified in the start tag, and they usually come in name-value pairs and the value must be inside the quotes, like name="value".

<tag attribute_name="attribute value"></tag>

You can add multiple attributes to an HTML element.

<!-- Multiple Attributes Example -->
<a href="" rel="follow">DevBabu.Com</a>

HTML Global Attributes

In the above, we have learned that some attributes are common to all elements means those can be used with all HTML elements, and such attributes are classified as global attributes.

List of attributes