HTML elements can have some attribute and all attributes provide the additional information about the HTML elements.
- The HTML attributes are specified in the start tag. That’s like <div width=”100%” height=”300px”> My Div</div>.
- The HTML attributes generally appear as name-value pairs in HTML document.
Know some HTML attribute in this tutorial. That’s like
The title Attribute
In HTML the title attribute is displayed as a tooltip in a web browser. Title is show on the page or paragraph, when you over the mouse on the text or paragraph.
The HTML title attribute is the global attribute contains text that represented some information. It is displayed in a small bubble when the cursor or mouse pointer over the link or paragraph.
Example:
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <p title="This is your paragraph"> This is a paragraph tag and set a title, over mouse here and show the result. </p> </body> </html>
The href Attribute
HTML href attribute is define a link address, the link address specify the another location of web page or another contains of the page.
- The href tag is defined in the <a> tag.
- The link address generate in the href attribute.
- The link address may be another web page link or page link of same directory.
Example:
<!DOCTYPE html> <html> <head> <title>Page title</title> </head> <body> <a href="http://datainflow.com">This is web link, click the link</a> </body> </html>
The alt Attribute
The HTML alt attribute is used to determine the attributes of an HTML element. It basically use in the img tag, when a image can’t get the proper path and image not display then show a text by alt attribute in a web application, which you define in the alt attribute.
Example:
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <img src="img/datainflow.jpg" style="width:300px;height:170px" alt="Go to datainflow.com"> </body> </html>