HTML links are hyperlinks.
Links are found in nearly all web pages. Links allow users to click their way from page to page.
The HTML <a> element with its href
attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.
<a href="https://www.google.com" > Go to google homepage </a>
The most important attribute of the <a> element is the href
attribute, which indicates the link's destination
By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link.
The target
attribute specifies where to open the linked document. Values are:
_self
which is default, opens in same window/tab as it was clicked_blank
opens in new window/tab_parent
opens in the parent frame_top
opens in the topmost browsing<a href="https://www.google.com" target="_self" > self target link </a> <a href="https://www.google.com" target="_blank" > blank target link </a>
To use an image as a link, just put the <img> tag inside the <a> tag:
<a href="https://www.google.com" >
<img src="link_img.gif" alt="link_img" width="150" >
</a>