Monday 17 December 2012

Lists Styles

HTML provides several ways to display lists of information:
1.  Ordered Lists

Ordered lists are contained by an ol element. Within the 'ol'tag, each list item is defined by an li element:

My Dot-com Business Plan

  1. Buy domain name
  2. Put up website
  3. ???
  4. Profit!

The default ordered list uses arabic numerals (1, 2, 3, …), but you can easily alter this behavior.

Placing one list within another is a nested list. The outer list will use upper-case Roman numerals, and the inner list will start counting independently, using upper-case letters. There are a large number of available list-style-types for ordered lists. The most common and well-supported values are upper-roman, lower-roman, upper-alpha, lower-alpha, and the default, decimal. If for some reason the browser doesn’t understand the value you specify, it just falls back to the default (decimal numbers).

Schedule for Monday

  1. Suppress Gaul
    1. Two more legions or three?
    2. Where to put victory arch? Forum's looking crowded...
  2. Have Cicero killed
  3. Lunch
  4. Head-and-hands-on-pike viewing at the Forum (casual dress ok?)

2. Unordered List
Unordered lists are similar to ordered lists, except that they do not have a particular order. Unordered lists even recycle the li element, which makes it easy to turn an ordered list into an unordered list and vice-versa. All you need do is turn your ols into uls:

My Dot-com Business Plan

  • Buy domain name
  • Put up website
  • ???
  • Profit!

Definition Lists
A definition list provides a list of terms and definitions.

The Jhon Dictionary

ABSURDITY, n.
A statement or belief manifestly inconsistent with one's own opinion.
ACADEME, n.
An ancient school where morality and philosophy were taught.
ACADEMY, n.
[from ACADEME] A modern school where football is taught.
ACCIDENT, n.
An inevitable occurrence due to the action of immutable natural laws.
You may provide multiple definitions for a term, or even multiple definitions and multiple terms, although this is less common. Some people also use definition lists to mark up screenplays and other exchanges of dialogue: the speaker is a dt and their dialogue is a dd. If you’re writing technical manuals, you can use definition lists to document variables, interface components, and more.

No comments:

Post a Comment