← HTML Fundamentals
Links, images and media · 15 MIN

Links and URL paths

Links and URL paths

The anchor element uses href to point to a destination. Relative URLs are resolved from the current page; absolute URLs include a scheme and host. Use descriptive link text, and use mailto or tel only when appropriate.

Try it yourself

Change the example, run it, and explain the result in your own words. Then create one variation of your own.

Key idea

Use the example as a starting point, not something to memorize. Practise, inspect the result and make small improvements.

Code example

<a href="about.html">About this course</a>
<a href="https://developer.mozilla.org/">MDN Web Docs</a>