Home

How to Make Lists of Links for HTML5 and CSS3 Programming

|
Updated:  
2016-03-26 13:17:42
|
HTML5 and CSS3 All-in-One For Dummies
Explore Book
Buy On Amazon

Many web pages turn out to be lists of links in HTML5 and CSS3 programming. Because lists and links go so well together, it's good to look at an example. Notice this list of links to books written by a certain author.

This example has no new code to figure out, but the page shows some interesting components:

  • The list: An ordinary unordered list.

  • Links: Each list item contains a link. The link has a reference (which you can't see immediately) and linkable text (which is marked like an ordinary link).

  • Descriptive text: After each link is some ordinary text that describes the link. Writing some text to accompany the actual link is very common.

    image0.jpg

This code shows the way the page is organized:

<!DOCTYPE html>
<html lang = "en-US">
 <head>
 <meta charset = "UTF-8">
 <title>listLinks.html</title>
 </head>
 <body>
 <h1>Some nice programming books</h1>
 <ul>
  <li><a href = "http://www.aharrisbooks.net/haio">
   HTML / CSS / JavaScript ALL in One for Dummies</a>
   A complete resource to web development</li>
  <li><a href = "http://www.aharrisbooks.net/jad">
   JavaScript / AJAX for Dummies</a>
   Using JavaScript, AJAX, and jQuery</li>
  <li><a href="http://www.aharrisbooks.net/pythonGame">
   Game Programming - the L Line</a>
   Game development in Python</li>
  <li><a href="http://www.aharrisbooks.net/h5g">
   HTML5 Game Development for Dummies</a>
   Building web and mobile games in HTML5</li>
 </ul>
 </body>
</html>

The indentation is interesting here. Each list item contains an anchor and some descriptive text. To keep the code organized, web developers tend to place the anchor inside the list item. The address sometimes goes on a new line if it's long, with the anchor text on a new line and the description on succeeding lines.

Normally, the tag goes at the end of the last line, so the beginning tags look like the bullets of an unordered list. This makes it easier to find your place when editing a list later.

About This Article

This article is from the book: 

About the book author:

Andy Harris earned a degree in Special Education from Indiana University/Purdue University–Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.
Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.
Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.
Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.
Andy welcomes comments and suggestions about his books. He can be reached at [email protected].