The <a> tag is a hyperlink, which is used to link one page to another.It uses with many attributes but **href** is most important attribute that have destination of linked page. The general attributes use with <a> tag are:-
download, hreflang, media, rel, target,title and type.
***These attributes are not useful without href.***
***withhout the href attribute, the <a> tag is not a hyperlink.***
how to add href in <a> tag:-
So we can say that it as main attribute of <a> tag and another attributes are sub attributes that used with href attribute.
Another use of href attribute:-
When a user goes bottom of page,again use scroll bar to get on up,so by using this attribute when user click on link,user get on up without using scroll bar.
<a href="mailto:somebody@example.com?Subject=write here subject">Send mail!</a> when you have installed mail,then if you click on this mail link mail will automatically send to whose you want to mail.
<a href="mailto:somebody@example.com?cc=someoneelse@example.com&bcc=andsomeoneelse@example.com &subject=write here subject&body=write here message">Send mail!</a>
<a href="javascript:alert('Hello webschool!');">Execute JavaScript</a>
***These attributes are not useful without href.***
e.g.
<a href="http://watchtvlive.in">watchtvlive</a>
when you click on "watchtvlive" the destination page of that web address will be load or open on parent page or new tab.
<a href="http://watchtvlive.in">watchtvlive</a>
when you click on "watchtvlive" the destination page of that web address will be load or open on parent page or new tab.
href Attribute
The href attribute specifies the URL of the linked page.***withhout the href attribute, the <a> tag is not a hyperlink.***
how to add href in <a> tag:-
e.g.
<a href="http://watchtvlive.in">Livetv</a>
it will look like when you add in paragraph:-
<a href="watchtvlive.in">watchtvlive</a> is a live tv website. =watchtvlive is a live tv website.
<a href="add here your web address which you want to linked with this page or when user click on this link user go to that page">you can write anything here</a>
<a href="http://watchtvlive.in">Livetv</a>
it will look like when you add in paragraph:-
<a href="watchtvlive.in">watchtvlive</a> is a live tv website. =watchtvlive is a live tv website.
<a href="add here your web address which you want to linked with this page or when user click on this link user go to that page">you can write anything here</a>
So we can say that it as main attribute of <a> tag and another attributes are sub attributes that used with href attribute.
Another use of href attribute:-
- go to top
When a user goes bottom of page,again use scroll bar to get on up,so by using this attribute when user click on link,user get on up without using scroll bar.
- Link to an email address with a specified subject:
<a href="mailto:somebody@example.com?Subject=write here subject">Send mail!</a> when you have installed mail,then if you click on this mail link mail will automatically send to whose you want to mail.
- Link to multiple email addresses with a specified subject and a specified message:
<a href="mailto:somebody@example.com?cc=someoneelse@example.com&bcc=andsomeoneelse@example.com &subject=write here subject&body=write here message">Send mail!</a>
- Link to a JavaScript:
<a href="javascript:alert('Hello webschool!');">Execute JavaScript</a>
Sub Attributes
- Tittle Attribution
- Download Attribute
- Target Attribute
****e.g.
<a href="http://www.watchtvlive.in.com" target="_blank">watchtvlive</a>
in the tag line target is attribute while ***_blank is it's value.****
- hreflang Attribute
e.g. of 2 letter codes english-en,hindi-hi,Arabic-ar
This comment has been removed by the author.
ReplyDeletelearn html,css and make your base for web designing
Delete