HTML Attribute Intro
HTML Attribute Intro
HTML Attribute
HTML attributes enhance the capability of HTML elements or tags.
-
It controls properties like size, color, name, font-family, and many more.
-
It is always specified in the starting tag.
-
It comes with name/value pairs like: name="value."
Example:
<p title="title of the paragraph">All the definition part goes here.....</p>
Example Explanation:
In the above, we have shown an example of HTML Attribute in which we use "title" attribute.
-
The title attribute is used to give the title of the paragraph.
-
To use the title attribute, we have to add it inside the opening tag after the name of any HTML element, as we have used in HTML paragraph tag <p title="title of the paragraph">.
-
When we hover the mouse on the paragraph then the title will be visible.
Run the code to see the effect.