Hyperlink example
- how to put url in html
- how to put link in html button
- how to add url in html button
- how to put link in html css
How to create hyperlink in html with example.
How to Create a Hyperlink in HTML?
If we want to navigate from one page to another then Hyperlink comes into play. It provides you the link to navigate to another page, on hovering that link the cursor turns into a little hand.
Hyperlink enables us to connect one page to another, navigate to specific sections, or even open applications through a web address. Almost any content can become a link, making it simple for users to move to different parts of the web with a click.
1.How to create a link to a website
Using <a>Tag
In this approach, we are using the <a> (anchor) tag to create a hyperlink. The href attribute within the <a> tag specifies the destination URL, allowing users to navigate to different sites.
Syntax
<a href = "link" target ="_blank"> Link Name </a>Example: When users click on the "Visit GeeksforGeeks" link, they will be directed to the GeeksforGeeks website in a new tab (due to the target="_blank" attribute).
Output
2.
Using HTML DOM Window.location Property
Another method for creating hyperlinks is to use the HTML DOM window.location property to
- how to put link in html table
- how to put image url in html