HTML5 Attributes

HTML5 elements can contain attributes and gets added to an HTML start tag. HTML5 Attributes are used to set properties of a specific element.

If you have an idea about name-value pairs, then it would be easier for you to understand how to work with attributes. Here’s an example,


  • HTML_Tag is the HTML tag i.e. element, for example <img>, <div>, <h1>
  • HTML_Attribute is the attribute, which provides value, for example, id, class, href, etc.

HTML5 Attributes

Some of the examples are given below,

As you can see above, href is our attribute for the element a. The href attribute provides the URL.

Another example,

As you can see above, src is our attribute for the element img. The src attribute specifies the URL of the image.

HTML5 Introduction
HTML5 Code structure
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading