Skip to main content
Practice

HTML a Tag

The HTML <a> tag is used to create links, which can navigate to other web pages or scroll to specific positions when clicked.

The <a> tag is used in the following way:

Usage of a Tag
<a href="URL">Link text or image</a>

By wrapping text or an image with the <a> tag, clicking on that text or image will navigate to the URL specified in the href attribute.

For example, the following HTML code creates a link that says "Go to Google":

a Tag Example
<a href="https://www.google.com">Go to Google</a>

When this code is added to a webpage, the text "Go to Google" will be displayed, and clicking this text will navigate to the Google website in the web browser.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.