Skip to Content
Practical Web Design
book

Practical Web Design

by Philippe Hong
April 2018
Beginner content levelBeginner
368 pages
7h 37m
English
Packt Publishing
Content preview from Practical Web Design

Inserting links

To make the menu work, we need to add links to our list; otherwise, it will go nowhere. To add a link, you have to use the tag <a>. To make each <li> element clickable as a link, we need to add the <a> tag inside the <li> tag, as follows:

<li><a>Upcoming events</a></li>

Now we need to specify where the link goes. For that, we need to add the attribute href:

<li><a href="upcoming.html">Upcoming events</a></li>

If the href attribute is not present, the <a> tag won't act as a hyperlink. The value of href can be an absolute link to another website or a relative link to a file on the same domain. It's basically the same behavior as the src attribute we saw earlier.

In the end, our menu should look like this:

<ul> <li><a href="upcoming.html">Upcoming ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Web Design Playground

Web Design Playground

Paul McFedries
Hello Web Design

Hello Web Design

Tracy Osborn
The Principles of Beautiful Web Design, 4th Edition

The Principles of Beautiful Web Design, 4th Edition

Jason Beaird, Alex Walker, James George

Publisher Resources

ISBN: 9781788395038Supplemental Content