Explain how to create a hyperlink in HTML.

Instruction: Show how to create a text link to another webpage.

Context: This question checks the candidate's ability to use anchor tags for creating links, a basic yet essential skill in HTML.

Official answer available

Preview the opening of the answer, then unlock the full walkthrough.

To create a text link to another webpage, we use the anchor tag <a> in HTML. The anchor tag requires an href attribute, which specifies the URL of the page the link goes to. The syntax for creating a simple text hyperlink is straightforward. You start with the opening tag <a>, include the href attribute followed by the URL, then place the text that will be clickable, and finally, close it with the </a> tag.

Here's a concrete example: <a href="https://www.example.com">Visit Example</a> In this example, "Visit Example" is the clickable text that users will see on the webpage. When they click on it, they will be directed to https://www.example.com....

Related Questions