Skip to Content
Learn
Site Structure
Anchor Elements

Nice work! The webpage is starting to come together.

What if you wanted to link users to a different webpage? The HTML anchor element makes it possible to do this with a single click.

<a href="http://google.com">Click here for Google!</a>

Anchor elements use an attribute to link users to websites. Attributes customize the behavior or appearance of HTML elements. Anchor elements use the href attribute, which specifies the webpage to link to. In the example above, the text “Click here for Google!” links to http://google.com.

IMPORTANT: Web addresses, such as http://google.com, have a technical name: URL.

Instructions

1.

Let’s create an anchor element to send visitors to a webpage that lists cities where Ollie bike sharing is available.

Between the opening <p> and closing </p> tags, after the last sentence, enter this text:

Here is a list of cities where you can find us.

Run your code to continue.

2.

Next, use an anchor element to link the word “list” to the URL cities.html.

Here is a <a href="cities.html">list</a> of cities where you can find us.

Note: cities.html is within the Ollie site folder, so we do not need to specify a full URL

When you have added the anchor element, run your code.

In the web browser, you will now see the word “list” underlined, indicating that the word is a link. Click on the link to test it out!

Folder Icon

Take this course for free

Already have an account?