An attribute is providing additional information for associated property about HTML elements and Html attribute can be written within a specified in start tag. Html attributes are written with of two parts: a name and a value
Attributes come in name/value pairs like: name="value"
Note: Html attribute names are case-insensitive and attribute values are not case-insensitive.
<!DOCTYPE html> <html> <head> <title>Align Attribute Example</title> </head> <body> <p align="left">welcome users in left aligned </p> <p align="center">welcome users in center aligned</p> <p align="right">This is right aligned</p> </body> </html>
HTML Attributes are shown as below :
|alt||It is used as an alternative text for an image|
|href||It is used as the URL (web address) for a link|
|id||SIt is used as a unique id for an element|
|src||It is used as the URL (web address) for an image|
|style||It is used as an inline CSS style for an element|
|title||It is used as extra information about an element (displayed as a tool tip)|
|value||It is used as the value (text content) for an input element.|
Example of the href Attribute
HTML href Attribute used a links with the <a> tag .
<a href="http://www.r4r.co.in">Welcome user's in a link</a>
Html images are used within <img> tag as follows :
<!DOCTYPE html> <html> <body> <p>Click following link</p> <a href="http://www.r4r.co.in" target="_self"> <img border="0" src="file:///C:/xampp/htdocs/images/logo.gif" width="72" height="72"></p> </body> </html>
when we click on this image and used a image attribute <img> with a link of own requried website then we have go to website.
In the HTML paragraphs are defined with the <p> tag.