A tag

From Dharmasphere

Jump to: navigation, search

110313947_91e8b5658d_m.jpg

Contents

<a> Anchor Tag

This is the HTML tag that makes the Internet what it is. It allows us to put hyperlinks (or simply, "links") to other web pages from our own pages. The links may be to pages within our own website, or to any other website on the World Wide Web.

Using The Tag

With this tag, we enclose the text that we want to turn into a hyperlink – i.e. the text that a user will click on to go to the new page - with an opening <a> tag and a closing </a> tag. For example:

Please <a>download my music</a> for free.

Including the Web Address

We also need to say which web page we want to link to. So, we need to give the tag some extra information - an attribute containing the web address of the page to link to.

The attribute we use is href, which stands for hypertext reference. It goes after the <a and before the > of the opening tag, followed by an equals sign = and the web address, which is enclosed in quotation marks ":

Please <a href="http://music.example.com">download my music</a> for free.

This code will result in:

Please download my music for free.

See Also

Personal tools