Unordered and ordered lists are the most common type of HTML list you find. One of the most popular uses of HTML unordered lists is for presenting your site navigation. However, there are basically three types of HTML lists you can use with your websites. They include:
Unordered lists can be used to present list items in no particular order and are marked with bullets (small black circles by default). An unordered list begins with the <ul> tag and each list item begins with the <li> tag.
Code
<ul>
<li>Redundant graphics</li>
<li>Save Navigation</li>
<li>Remove Themes</li>
<li>DL Web Package</li>
<li>Preserve Regions</li>
<li>Insert DocType</li>
<li>Remove bots</li>
</ul>
Browser Display
Ordered lists can be used when the listed item content is supposed to be in a special order so as to add meaning to the list. List items are marked with numbers by default. An ordered list begins with the <ol> tag and each list item begins starts with the <li> tag.
Ordered lists would be useful for giving instructions that need to be followed in a certain order or a recipe where ingredients are added in a specific order.
Code
<ol>
<li>Right-click on a ZIP file and select the 'Extract All' menu option. </li>
<li>Browse to the Desktop or Folder where you want the files extracted to. The default is to show the extracted files when complete. Untick this if you do NOT want to view the file at this time. </li>
<li>Click 'Extract.' </li>
<li>Your files are now extracted to the directory you have specified and you can begin to use them. </li>
</ol>
Browser Display
Definition lists is a list of items, with a description of each item. The <dl> tag defines the beginning of a definition list and acts as the container for the list. The <dt> tag is used for the definition term and and <dd> defines the definition description. The default styling of definition list indents any descriptions.
Code:
<dl>
<dt>Coffee</dt>
<dd>Coffee is a brewed beverage with a distinct aroma and flavor prepared
from the roasted seeds of the Coffea plant.</dd>
<dt>Tea</dt>
<dd>Tea is an aromatic beverage commonly prepared by pouring hot or
boiling water over cured leaves of the tea plant.</dd>
<dt>Hot chocolate</dt>
<dd>Hot chocolate (also known as hot cocoa) is a heated beverage
typically consisting of shaved chocolate, melted chocolate or cocoa powder,
heated milk or water, and sugar.</dd>
</dl>
Browser Display
Nested lists are lists within a list. Different list types may be used together.
Your major concern in working with nested lists will be to verify that each list is properly ended and the nesting order is correct.
Code
<ul>
<li>Import Web Package</li>
<li>Use Cleanup Toolbar
<ul>
<li>Compatibility</li>
<li>Clean Tables</li>
<li>Accessible Tables</li>
<li>Apply XHTML</li>
</ul>
</li>
<li>Replace Bots</li>
<li>Compatibility Reports</li>
<li>Accessibility Reports</li>
<li>CSS Reports</li>
<li>Add Semantic Markup<ul>
<li>Heading Tags</li>
</ul>
</li>
<li>Add Meta Tags</li>
<li>Preview in browser</li>
<li>Validation</li>
<li>Run Queries</li>
</ul>
Browser Display
NOTE: If you are using Expression Web as your web editor, and your list items are not properly nested. EW will notify you by highlighting and red squiggly lines under the incorrect elements. Hovering over the element will give you a tip about what is wrong. View Screenshot
You can change the default styling of ANY HTML list by using CSS.
The list-style-type property sets the type of bullet or numbering to a list.
list-style-type: { circle | disc | square | armenian | decimal | decimal-leading-zero | georgian | lower-alpha | lower-greek | lower-latin | lower-roman | upper-alpha | upper-latin | upper-roman | none | inherit } ;
Example:
ul li {list-style-type: square;}
ol li {list-style-type: upper-roman;}
The list-style position property specifies where to place the list-item marker.
list-style-position: { inside | outside | inherit } ;
Example:
ul {list-style-position:inside;}
The list-style-image property replaces the list-item marker with an image.
Example:
#content li { list-style-image: url('images/pink-bullet-bg.gif'); }
The list-style property is shorthand which sets all the list properties in one declaration. Note that an omitted property value will be set to that property’s initial value.
Example:
ul { list-style:square inside ; }
ol { list-style:upper-roman inside ; }
One of the most common uses for the unordered list is the navigation bar, whether vertical or horizontal. CSS Navigation Bar
If you Google horizontal or vertical navigation, you will find many resources for turning your unordered list into simple or more complicated site navigation.
These are just a few of the resource links available for working with lists.
Written December 2012
Copyright © Pat Geary of Expression Web Tutorials and Templates
Expression Web 4.0 Tutorials 2nd Edition from Install to Publish, a FREE EBook by Pat Geary.
Expression Web has a group on Facebook. If you are a FB user, come join us.
Disclosure: This is an affiliate link, which means that if you visit Bluehost.com through this link and purchase this product, I’ll get a commission.
April 2007 - April 2013
Privacy Policy | Migrating from FrontPage to Expression Web
Microsoft® and Expression Web® are registered trademarks of Microsoft® Corporation.
Site Design & Maintenance : Expression Web Tutorials & Templates