
Have you ever wondered about how hyperlinks are created on different websites? It is all made possible with the help of HTML link tag. This fundamental component of web development basically makes it easy for users to navigate between web pages and resources.
In this detailed guide, we will explore everything you need to know about the HTML link tag, from its basic syntax to advanced usage. Reading this article will help you to implement and customize hyperlinks effectively in your web projects.
When users click on "Our homepage," they will be taken to `https://pwskills.com`. This simple structure is the foundation of creating links in HTML.
| HTML Link Attributes | |
| Attribute | Description |
| _blank | It is used for opening the link into a new tab or window. |
| _self | It is used for opening the linked document in the same tab. |
| _parent | It generally opens the document in the parent frame. |
| framename | It opens the document in the specified frame. |
| Styling HTML Link Using CSS [HTML Link Hover Effect Syntax] |
| a:hover { color: red; /* Changes text color to red on hover */ text-decoration: underline; /* Underlines the text on hover */ } |
| Detailed Example Of HTML Link |
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Welcome To PW Skills</title> <style> body { font-family: Arial, sans-serif; background-color: #f0f0f0; /* Light grey background */ color: #333; /* Dark grey text color */ margin: 0; padding: 0; } h2 { background-color: #007bff; /* Blue background for title */ color: #fff; /* White text color */ padding: 10px; text-align: center; } p { margin-bottom: 15px; } a { color: #007bff; /* Blue link color */ text-decoration: none; } a:hover { text-decoration: underline; /* Hover effect installation */ } </style> </head> <body> <h2>Welcome To PW Skills</h2> <!-- External link to a PW skills article --> <p><a href="https://www.PWskills.com/" target="_blank" rel="noopener noreferrer">PW Skills Site (External)</a></p> <!-- Internal link to a specific PW skills page --> <p><a href="https://pwskills.com/web-development/full-stack-web-development-course//">Full Stack Development Course</a></p> <!-- Anchor link within the same page to a PW skills section --> <p><a href="#contact">Contact for PW Skills Support</a></p> <!-- Email link to contact for PW skills coaching --> <p><a href="mailto:sahil.chikara@pw.live">Contact for PW Skills Support</a></p> <p><a href="https://www.example.com/pw-skills-resources" target="_blank" rel="noopener noreferrer" title="Explore PW Skills Resources">Explore PW Skills Resources</a></p> </body> </html> |
These are the styling effects that you can add to links. You can even change the link color and font. I have taken a blue color here, you can refer to the above-detailed code and change it as per your requirement.
Also Read: