You are being redirected to the new blog! If you are not redirected in 3 seconds click here

Monday, November 5, 2007

The a Tag


The a tag is one of the most used tags in all of XHTML and HTML for that matter. The a means anchor and it links between XHTML pages or other files like PDFS or downloads like executables. When people click on them it sends them to the linked file. The browser knows to interpret files like .html .xhtml .xml .htm .php. aspx .asp and on until the cows come home. However, when the browser encounters a file that it doesn't know what to do with it gives you a popup box like this:


Firefox Screenshot

But what do you write to get the a tag to go where you want? The href attribute tells it where to go. Example:

<a href="http://cnn.com">Click Me</a>

The href part is the attribute and http://cnn.com is the value of the attribute.

The official name is a hyperlink but it is more commonly known as a link. I personally find this particular tag quite useful.

No comments: