19 Aug Inserting Hyperlinks on an HTML web page
Links in an HTML web page helps in linking one page to another. For example, below we have some links:
Above, the text “Python Dictionay”, “Python Tuples”, “Java”, Python” are all Hypelinks. On clicking, the respective link, the linked page will open.
To add a hyperlink, use the <a></a> tag and the href attribute,
1 2 3 |
<a href="">Learn Programming</a> |
Whatever text comes inside the <a>…</a> tag becomes hypelink. For example, above the text “Love Programming” becomes a link.
Under the above <a> tag, we will add the link. Following is how you can add a hyperlink correctly in HTML:
1 2 3 |
<a href="https://studyopedia.comn/tutorials">Learn Programming</a> |
The <a>…</a> tag should always come inside the <body>…</body> tags.
Example
Following example gives an overview of how to add links to an HTML web page,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<!DOCTYPE html> <html> <head> <title>HTML Links Example</title> </head> <body> <h2>Tutorials</h2> <a href="/tutorials/drupal-commerce">Drupal Commerce</a> <a href="/tutorials/prestashop">Prestashop</a> <a href="/tutorials/java">Java</a> <a href="/tutorials/cpp">C++</a> </body> </html> |
No Comments