Html Hyperlinks
Advertisements
Html Hyperlinks
Hyperlinks are used to create links that allow the users to navigate from one page to another. To create hyperlinks use <a> tag. <a> tag have following attributes;
- href: href attribute specifies the destination address like www.tutorial4us.com/html/
- target: target attribute specifies where to open the linked document like open in new window, open in same window.
Example
<html> <body> Link open in same window<a href="#" target="_top">Click Here</a> Link open in new window<a href="#" target="_blank">Click Here</a> </body> </html>
Result
Target Attribute
Target Value | Description | |
---|---|---|
_blank | Opens the linked document in new window | |
_top | Opens the linked document in same window | |
_self | Opens the linked document in same frame as it was clicked (this is default) | |
framename | Opens the linked document in a given named frame | |
_parent | Opens the linked document in the parent frame |
Image as Link
In html you can give image as a link, when click on image linked page will be open. In below example image link is provided.
Example
<html> <body> <a href="/html/index" target="_top"><img src="files/sublogo.png" target="_blank"></a> </body> </html>
Browser supported
Element | |||||
<a> | Yes | Yes | Yes | Yes | Yes |
Google Advertisment