What are Attributes?
HTML elements have some attributes to provide extra information about that
element. These attributes are mentioned in the opening tag of element. An attribute
has two parts name and its value.
Some of the attributes are given below with explaination.
The id attribute is used to give an element unique identity within a page.
As you can see in the above example we can uniquely identify two paragraphs by using their id attribute
The title attribute is used to give a title to the element.
This is a simple paragraph whose title is specified.
To see the effect of title attribute hover the mouse cursor on the output. You will notice a tooltip having the same text as you mentioned in title attribute.
The href attribute is used to store the link for <a> tag.
The style attribute is used to specify CSS rules. you will study more about CSS in later chapters.
Heading using Style attribute