Share this Page URL

Part: 1 Creating Your First Web Page > The Gist of a List: Adding Lists to Your... - Pg. 41

41 Chapter 4. The Gist of a List: Adding Lists to Your Page In This Chapter · Creating numbered lists on your web page · How to set up bulleted lists · Cobbling together a definition list · More list examples than you can shake a stick at Are you making a list and checking it twice? Gonna find out who's naughty and ... oops, drifted off to the North Pole for a second! But if you do want to include a list in your web page, what's the best way to go about it? You saw in the previous chapter how you can use the <BR> (line break) tag to display items on separate lines. That works well enough, I guess, but hold your list horses--there's a better way. HTML has a few tags that are specially designed to give you much more control over your list-building chores. In fact, HTML offers no less than three different list styles: numbered lists, bulleted lists, and definition lists. This chapter takes you through the basics of each list type and provides you with plenty of examples. Putting Your Affairs in Order with Numbered Lists If you want to include a numbered list of items--it could be a top-ten list, bowling league standings, or any kind of ranking--don't bother adding in the numbers yourself. Instead, you can use HTML ordered lists to make the web browser generate the numbers for you. Ordered lists use two types of tags: · The entire list is surrounded by the <OL> (ordered list) and </OL> tags. · Each item in the list is preceded by the <LI> (list item) tag and is closed with the </LI> end tag. The general setup looks like this: <OL> <LI>First item.</LI> <LI>Second item.</LI> <LI>Third item.</LI> <LI>You get the idea.</LI> </OL> Here's an example (see numlist1.htm on the CD in this book): <HTML> <HEAD> <TITLE>Numbered Lists - Example #1</TITLE> </HEAD> <BODY>