What is Attribute?
The properties applied on the tags to perform advanced actions on the tags are called attributes.
For example,
All the heading tags have align attribute to align the text as left, right and center
Note: Attributes are written in the opening part of the tag separated by space.
Example
<h1>Hello India</h1>
<h1 align='center'>Hello United States</h1>
Here first heading will appear left aligned while second heading will appear center aligned
All the tags have one or more attributes. Attributes are separated by space. For example
<img> tag has the following attributes
- src="source file name"
- width="x"
- height="y"
- title="image title"
- alt="alternate text"
Using the given attributes we can display an image in a web page
<img src="demo.png" width="200px" height="200px" title="Demo Image" alt="demo image">
Comments
Post a Comment
Dear Students and Readers, your comments are valuable for us.
For any issue please share your views with us on our official email ID info@vigorcouncil.org