| Free HTML Tutorials • CSS • Frames Tutorials • Forms Tutorials • Beginners HTML Tutorials • Advanced HTML Tutorials • JavaScripts • Free Web Page Tutorials • Free Downloads |
|
Beginners Section |
|
LISTS OF THINGS |
|
|
|
|
We will look at two different list styles and nested lists. Here they are - in a list of course:
ORDERED or NUMBERED LISTS A numbered list of items could be a top forty list, favourite foods or any kind of list that need a ranking order. You don't need to put the numbers in - they will be automatically generated by using the correct code for your list. Ordered Lists use two types of tags:
There are a few different options for numbered lists. If you start the list with <OL CONTINUE> that tells the browser to start this list's numbers where a previous list left off. You can also use a <LH> (list header) tag to specify a title for the list. Here is the code:
THE PLANETS
As you can see, the numbers were automatically generated by the code. Your list items don't have to be just plain text, you can insert other HTML tags. For example, you could use <B> and </B>, you could use a tag to increase the font size of the item, or you could make an item a link to another page. BULLETED OR UNORDERED LISTS Bulleted or unordered lists place a dot or square, depending on the browser, at the beginning of each item in a list. As with the numbered or ordered list, start each item with the <LI> tag, but enclose the whole list with the <UL> and </UL> tags. And here is what a list will look like with bullets instead of numbers:
MY SIX FAVOURITE FLOWERS
COMBINING OR NESTING LISTS You can also combine or nest lists one inside the other. For example, you can insert a bulleted list after or within a numbered list item. Or a couple of bulleted lists inside a list. I'll use an index type example of a nested list. Here is the code for the first part:
Try combining ordered and unordered lists or use them for headings and sub-headings or even sub-sub-headings. You may have to experiment a bit, but just be careful to close off each section with the right tags.
As mentioned previously, you are not limited to plain black for font colours or to the default font face. Just like any other piece of code you can specify the font and colour. The bit below uses the Comic Sans font face with blue and red specified as the colours.
MY SIX FAVOURITE PASTIMES
AN EXTRA TIP OR TWO
For a full web page, straight after <BODY> and before you put in your content, type in <UL>. At the very end, before </BODY>, close the tag with </UL>. It's a bit hard to show you a full page example here, so try it out for yourself. If you need to use a list within the document, make sure you use the opening and closing tags correctly or you will end up in a mess.
Help
|