HTML Code Tutorial
You can Test the simple list Codes online in this: HTML editor
Lists
Lists can be great tools for presenting data on a webpage.
Their various types can be used separately or they can be nested within each other to present complicated data displays in an organized manner.
Lists can be used for other purposes like creating drop down menus like the one used on the top of this page.
There are 3 different kinds of lists which can be displayed using HTML.
They are:
Unordered,
Ordered
and Definition lists.
Most inline attributes for setting list types are deprecated in the latest version of HTML4.
Use style sheets to set types and attributes.
Note: Items in a list do require a closing tag for w3c compliance. </li>
Create a FREE Website
NO CODING!!
Create beautiful, professional websites
WITHOUT Learning to Code!!
19 Million+ Amazing FLASH websites
created by people just like you,
with no knowledge of HTML coding.
Unordered Lists
List items in an unordered list are preceded by a bullet. To designate the bullet selection of DISC, SQUARE or CIRCLE use style sheets.
Example: list-style : disc or list-style-type : disc.
To eliminate the bullet use the style sheet code: list-style : none or list-style-type : none.
Unordered list:
The Code: <ul style="list-style: disc"> |
Unordered list:
The Code: <ul style="list-style: square"> |
You can Test the simple list Codes online in this: HTML editor
Ordered Lists
Ordered List Types: The items of an ordered list are preceded by letters or numbers instead of bullets. The choices are integers as 1,2,3....., letters as upper or lower case A,B,C... a,b,c.... and Roman Numerals upper or lower case as I,II,III... i,ii,iii....
Types of ordered lists are set using style sheets.
Example: list-style : lower-alpha or list-style-type : integer
Choices are: integer, lower-alpha, upper-alpha, lower-roman, upper-roman.
Ordered list:
The Code: <ol style="list-style-type: integer">
|
Ordered list:
The Code: <ol style="list-style-type: lower-alpha">
|
The Start attribute used in earlier versions of HTML is Deprecated. You can restart the lettering or numbering in a nested list using the value attribute in the list item tag as shown above.
You can Test the simple list Codes online in this: HTML editor
Definition Lists
The definition list is handy for displaying a list of terms and their definitions. The definition <dd> is automatically indented below its associated term <dt>.
Definition list:
|
The Code:
<dl>
|
An easy way to remember which tag goes where: <dt> = Define Term
<dd> = Define Definition
You can Test Code in this HTML editor.
Nesting Lists
Different types of lists can be nested or placed within each other to create sophisticated hierarchical structures.
|
|
Tricks With Lists and CSS
Lists can be used to create menus or text site maps for your website.
You could use a list of simple headings and hyperlinks and set them in a structure similar to one of those shown above. Or you could use a combination of hyperlinks and images.
|
Table of Contents: |
The Style Sheets: |
The code:
<div ID="links" STYLE=";border: solid #000 2px; width :250px">
<p STYLE="font-family: Arial;font-style : italic ;font-size : 14pt; font-weight :bold;text-align : left; color :#0000FF">Table of Contents:
<ul style="list-style-image: url(images/heart.gif)">
<li><a href="#toppage">Unordered Lists</a></li>
<li><a href="#ordered">Ordered Lists</a></li>
<li><a href="#definition">Definition Lists</a></li>
<li><a href="#tricks">Tricks With Lists</a></li>
</ul>
</div>
Hover Property
IE7 and Mozilla browsers accept the CSS hover property for list items. This allows you to create some interesting effects when building menus and navigational links.
|
|
If you are using an IE7 or Mozilla browser, the buttons on the left will change color when you hold the mouse cursor over them. The effect is created by using 2 different buttons. The second button of a different color is displayed when the hover property is accessed for the list item. There is no confusing javascript - just 2 lines in the style sheet. | |
The HTML code: |
The CSS code: |
Copy these buttons to make it work on your web page:

Best when placed on background color #0060ff
Note: If the list item hover property doesn't work in your IE7 browser try changing the Doctype at the top of your web page to: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
You can Test the simple list Codes online in this: HTML editor
Take a Quiz on this Information.
Check out our Free Frames Template Kit or try our Free Frames Kit Demo
Contents
Home
Introduction
Learning the Basics
Page Structure
Basic HTML Page
Doctype
The Body Tag
The Division Tag
The ID Attribute
Float Property
Navigation
Anchor Tag
Anchor Tag - Intradocument
Anchor Tag - Image
Text Controls
Style Sheets
Working With Fonts
The Header Tag
The Paragraph Tag
Paragraphs-Images
Using Lists
The Pre Tag
Line Break Tag
Tables
Basics of Tables
Colspan
Forms
Form Basics
Check Boxes
Text Boxes
Selection Boxes
Frames
Basic Frames
Target and Scrolling
Search Engines
Miscellaneous
Meta Tags
Using Borders
Horizontal Rule
Buttons with CSS
Using Color
Color Chart
Using Images
Using Templates
Uploading HTML pages.
HTML-CSS Quizzes
Our Recommended
HTML Editors
Download CoffeeCup HTML Editor
Click Here

HTMLPad 2011
We Compared the 2 HTML Editors




