What is attribute in HTML?
Attributes are extra bit
of information which is used to define the characteristics of an element.
Attributes are place inside opening tag and their value sit inside quotation
mark. (name=”value”)
Example of defining an
attribute
<tag attribute=”value”>Your
text here</tag>
<p title=”this is
attribute value”>Your text here</p>
Some types of attributes that we can use in html
The href attribute
<href> = the <href> create a link. You can jump the page and the close tag </href>
EXAMPLE:- <a href=”http://www.java.com”>this is a link</a>
The size attribute
<src>
= this is a source (src), and the size of the image (width and height) are all
provided as attributes
EXAMPLE:- <img src="image.jpg" alt=”living
mom” width="104" height="142">
The alt Attribute
<alt> = The required alt attribute
specifies an alternate text for an image, The alt attribute provides
alternative information for an image . alt create a tooltip for an image, use the title attribute!
EXAMPLE:- <img src=”imagenew.jpg ” alt="yo yo
honey singh">
0 comments :
Post a Comment