The Target Attribute
Just like the IMG tag, the A HREF tag can take attributes. One of these is called TARGET. The TARGET attribute is used to tell the browser where you want to open the link. For example, you can tell the browser to open the linked page in a new browser window. There are several values to choose from:
_blank
_parent
_self
_top
However, the only really useful one in HTML version 5 is BLANK. The default is SELF, so you don't need to specify a TARGET attribute most of the time. If you want the link to open up in a new window, the code is this:
<A HREF="pages/about.html" TARGET="_blank">About this site</A>
Notice the underscore character before the word "blank". Miss this out and your TARGET attribute won't work.
The other two TARGET attributes are for when your website uses something called FRAMES. Frames are going out of use, though, and are not recommended for HTML5.
No comments:
Post a Comment