In the previous post, we have understood the below HTML basics:
- > HTML Structure
- > Also understand the previous posts on HTML in this tutorial for understanding the HTML basics (Click here to get started on HTML Basics for Selenium)
Once you have understood the above HTML Structure, you can now understand the steps for adding & displaying hyperlinks on the Web Page using HTML.
Let’s get started
HTML for Selenium (Part 8) – Adding links to Web Page
Follow the below steps for adding and displaying hyperlinks on the Web Page using HTML.
1) HTML provides the tags <a> .. </a> for adding and displaying hyperlinks on the Web Page. The following example of the same:
<a href="https://www.qafox.com"> QAFox </a>
Here in the above example, href is an attribute and https://www.qafox.com is the URL value assigned to the attribute.
QAFox is the hyperlink text that will be displayed on the web page. Let’s see this in a practical way by following the below steps:
2) Download the Document having HTML structure from here (Download here)
3) Open the above-downloaded Document in NotePad++ as shown below:
4) Add the <a> .. </a> tag along with the attribute and hyperlink text to be displayed in different heading sizes on the Web Page inside the <body> tags as shown below and save:
5) Right click on the above-saved HTML file and select ‘Open’ option as shown below:
6) Observe that the Text provided between the <a> tags in HTML code will be displayed as a hyperlink on the web page pointing to the href attribute value (i.e. https://www.qafox.com) as shown below:
Here concludes this article and will explain more HTML basics in the upcoming posts.
- > To learn more about Selenium, continue to the next post (Click on Next Post link below)
- > Check complete Selenium Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning 🙂
On a mission to contribute to the Software Testing Community in all possible ways.