HTML Links

    Links are the clickable text that can lead you to a specific point on the same page or another page.


    HTML links are also known as hyper or anchor link. Links are generally used to jump to a specific point on the same or another page. When you hover the move over the link the mouse icon change from default to a clickable hand. Images and glyph icons can also be used as a link.

    HTML Links

    To create a link we use <a> element which stands for the anchor tag. Syntax:

    <a href="URL"> Text</a>
    It is mandatory to mention the href attribute, because it specifies the URL or destination of the link.


    <a href=""> TechGeekBuzz </a>
    <a href=""> Google </a>

    Link Target Attribute

    The target attribute specifies how the link will be opened on the browser when the user clicks on it. There are four values associated with the target attribute.

    • _self : It is the default target value, and this opens the target URL on the same tab and window.
    • _blank : It opens the link URL at the same window and new tab.
    • _parent : It opens the Link URL in the parent frame.
    • _top : It opens the link URL in the full body of the window.


    <a href="" target="_blank">

    Output TechGeekBuzz

    Image Links

    An image could also be used as a link. Example

    <a href="">
         <img src="image.jpg" 

    It is very important to resize your image using the CSS property when you use the image a Link.

    Button Links

    In HTML 5 we have an element called <button>, which is used to create buttons on the web page. Buttons are also be used to present links.


    <a href="" target="_blank">

    Output TechGeekBuzz

    Link Title attribute

    We use the title attribute to provide additional information about the link. The user can see the information by hovering the mouse over the link.


    <a href="" 
    title="This Will lead you to techgeekbuzz official home page">

    Output Techgeekbuzz

    Link to the Same Page

    <a> element can also be used to point to a section of the same web page. This technique often uses when the page contains too much content, and we want to provide some link that could take the user directly to a specific section of the page.


    <a href="#id name"> Link Name</a>
    <p id ="Id Name"> content</p>


    <a href="#hyperlinks">
    <p id="hyperlinks"> This is the content about hyperlinks</p>


    • Links are the clickable elements that can lead to a specific URL or location.
    • In HTML links can be created using <a> anchor tag.
    • href attribute contains the destination URL or location.
    • title attribute provides additional information about the link.
    • <a> tag can also be used to jump to a specific location on the same web page.

    People are also reading: