Put a page together

INPUT · Slides

Join pages with links

01 / 05

Joining one page to another

The thing that makes the web the web is that you press something and end up on another page. That is a link.

The tag that makes one is <a> — the a of anchor, the thing that fastens one place to another.

02 / 05

Where it goes is an "attribute"

Whatever you wrap in <a> becomes pressable. But where it goes cannot be decided by the text alone.

So you add href="where it goes" inside the opening tag. Extra information written into a tag like this is called an attribute.

<a href="menu.html">See the menu</a>

03 / 05

How to write an attribute

An attribute goes inside the opening tag only. You never write one in the closing tag.

  • a space after the tag name
  • href … the name of the attribute
  • an =, then the value wrapped in "

Forget to close the " and you get no link at all, so watch for that.

<a href="about.html">About the shop</a>

04 / 05

A file in the same place needs only its name

If you are going to a page kept in the same place, href only needs the file name.

When you go off to somebody else's site, you write the whole address, starting from https://.

<a href="access.html">How to find us</a><a href="https://example.com">Another site</a>

05 / 05

Make the text say where it goes

Link text should not be "here". Make it say what you will see if you press it.

That is kinder both to people reading with their eyes and to people using a screen reader.

<p>Have a look at the <a href="menu.html">menu</a> as well</p>