
Open another webpage by linking pages in HTMLįor the first link, it will open the websiteįor the second link, it will open a webpage stored at local system Stay stunned with us for the latest news and update across all over globe In this example, we are adding a simple HTML link to one for the website, and another is a webpage that is locally stored in our system. Here are the following examples mention below Example #1 So whenever a click event has occurred, it will open the linked page. Image as an HTML Link: One more feature of an HTML link is to consider the image as a link in an HTML document this can be defined as follows:īutton as a link: One can define a button as a link in HTML, too additionally, we have to add some javascript code with it. So we can download files types like PDF, zip, jpg, etc.Įxample: This will download file in PDF format It has the same thing defining text as a link and just adds the destination file’s path as a URL, so whenever we are clicking this link, the connected documents or webpage automatically gets downloaded. With the help of linking in HTML, we can also create links that help us to download documents. One can also directly open a particular section from another page simply defining that page’s url into the anchor tag with href attribute this is as follows:Įxample: Contact US Link to download the document This code works as a bookmark, so can jump directly to the home

To define bookmark, we have to add id as an attribute to a specific element to where we actually want to jump than its value by passing a sign called ‘#’, which is included in href within the tag. These features work as a bookmark for our web page whenever we want to find something from large page data, then simply define some text or document as a link to jump directly to this targeted location. Let’s see how to create bookmark anchors using the link in HTML. We are also familiar with how to deal with targets for the link to do functionalities like opening new blank windows, opening the webpage in the parent window, opening page in the self window like by default we are using this, opening the document in a full browser window using _top attribute and many more things.

Syntax: How to link the page by using the HTML?Īs earlier, we have seen how to link web pages, images, and other documents by using an anchor tag with a href attribute, which is by defining both file path like Absolute and Relative.
