Sunday, 16 August 2015

Html Links

Html Links:

Hyper Links-Html Links:

Htm links are called hyperlinks.
Hyperlink is an image or text that you can click on or jump to another document.

Syntax - Html Link:

<a> tag defines links in html.

Example:


Example:


href attribute defines destination address(http://www.learnhtmlwithdanyal.blogspot.com/html/)
Link text is visible(Visit my HTML blog).
When you will click on link text it will send you to specified address.

Local Links:

Above example is used in an absolute url i.e. a full web address.
Local link is specified with the same website with relative url that is without (http://www....)

Example:


Colors - Html Links:

When you move mouse on an link normally two things happen:
1)Mouse arrow will turn to little hand.
2)Color of link element will change.

Link will appear like this by default in all browsers:

1)Unvisited link will underlined and blue.
2)Visited link will underlined and purple.
3)Active link will underlined and red.
These colors can be changed by using style.

Example:


Target Atrributes - Html Links:

Target attribute defines where to open linked document.
Example will open link in new tab or window in a browser.

Example:



If your webpage is locked in frame to  break out frame use target="_top".

Example:


Image As Link -Html Links:

Commly we use image as link.

Example:


Create A Bookmark - Html Links:

Html bookmarks allow reader to jump to specific parts of web page.
These bookmarks are paractical if your website has long pages.
When you will be going to make bookmark first you have to creat bookmark and then add a link.
When link will be clicked page will scroll down to  the location with  bookmark.

Example:

Make bookmark with id attribute.

Add a link to bookmark.

Or add a link to bookmark on another page.

Example:


No comments:

Post a Comment