we normally see many links in almost every web page, links allow users to click their way from the page
HTML Links – Hyperlinks: can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand.
Hyperlinks are defined with the HTML <a> tag
<a href="url">link text</a>
<a href="http://www.learnsimpli.com/category/programming/html/">Visit our HTML tutorial</a>
The href attribute specifies the destination address (http://www.learnsimpli.com/) of the link. The link text is the visible part (Visit our HTML tutorial).
Local Links: The example above used an absolute URL (a full web address).
A local link (link to the same web site) is specified with a relative URL (without https://www….).
<a href="html_images.asp">HTML Images</a>
HTML Links – The target Attribute:
The target attribute specifies where to open the linked document.
The target attribute can have one of the following:
_blank
– Opens the linked document in a new window or tab_self
– Opens the linked document in the same window/tab as it was clicked (this is the default)_parent
– Opens the linked document in the parent frame_top
– Opens the linked document in the full body of the window- framename – Opens the linked document in a named frame
Example:
<a href="https://www.nswebsters.com/" target="_blank">Visit NSWebsters !</a>
HTML Links – Image as Link:
It is common to use images as links
<a href="default.asp"> <img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0;"> </a>
Link Titles: The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element.
<a href="https://www.nswebsters.com/" title="Go to W3Schools HTML section">Visit website development</a>
External Paths: External pages can be referenced with a full URL or with a path relative to the current web page.
Example:
<a href="http://www.learnsimpli.com/">HTML tutorial</a>
2 thoughts on “HTML LINKS”
Comments are closed.