What is attribute in HTML? Types of attributes

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">


There are many attributes in html. 

If you know some other feel free to comment 


Share on Google Plus

About Rahul Rana

I am an experienced web designer and SEO expert. I am running my own online marketing company i.e "SEO To Web Design". Thanks for reading, keep sharing online marketing and web design knowledge.
    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment

Enter your email address:

Delivered by FeedBurner