Taming Lists – Comp 416

World Chess Champions - unordered list
World Chess Champions - ordered list
  1. Tigran Petrosian
  2. Bobby Fischer
  3. Gary Kasparov
  4. Boris Spassky
Definition list
HTML
A markup language that specifies the structure of a web page.
CSS
Cascading style sheet
A language that specifies the presentation of a web page on the screen.
Javascript
A programming language that specifies, in part, the behaviors of a web page.
A programming language designed to frustrate and irritate web designers.
World Chess Champions - less intrusive bullet
    Different ways to style the "less intrusive bullet"
       a) Style within the opening tag.  This is fine for development when
          you are experiementing but should be removed from finished,
          production code.
          
             <ul style="list-style-type: circle;"\>
             
       b) Create a CSS class
       
             <ul class="lessIntrusiveBullet"\>
             
          along with the CSS rule
          
             .lessIntrusiveBullet { list-style-type: circle; }
             
          This class can then be applied to any HTML element.  However, since it is 
          meaningful only for unordered list, overspecifying the CSS rule will not
          change its application but will be clearer to anyone reading your style sheet.
          
              ul.lessIntrusiveBullet { list-style-type: circle; }
              
        c) Create an id     
        
            <ul id="lessIntrusiveBullet"\>
         
            ul#lessIntrusiveBullet { list-style-type: circle; }
            
           Sinces ids must be unique, this rule can be applied only once to a document.
           It is used primarily for page layout elements that appear only once per page:
           header, navigation panel, main page content, footer, etc.
           
        d) Make it the default for all unordered lists
        
           ul { list-style-type: circle; }
           
           You can alway override the default when needed.
           
        e) Make it a contextual default. For example, in the navigation panel (a div 
           element), you may have a list of anchors that are formatted differently from
           lists and anchors appearing elsewhere in the page.
           
           div#navigation ul { list-style-type: circle; }
           div#navigation a { color: rgb(27, 144, 178);
                              text-decoration: none; }
                              
           These rules will apply only within your navigation panel
           
           <div id="navigation">    </div>
             
  
World Chess Champions - no bullet
World Chess Champions - aligned left, no bullet
World Chess Champions - aligned with 'margin' property. Note that 'list-style-position' property does not seem to work??
World Chess Champions - Nested lists. Be careful in the syntax of the nesting.
World Chess Champions - boxed with 'border' property.

Boxing elements is a useful diagnostic style during web page development. You may need to see where a block element starts and ends, especially for accurate alignment. Note that Firebug helps with this (see also the Layout panel). Additionally, using the 'outline' property rather than 'border' has the advantage that an 'outline' does not actually occupy space in your layout whereas a 'border' does (but usually only a single pixel).

The examples below improve the layout by using 'margin' and 'padding'.

World Chess Champions - more smoothly boxed
World Chess Champions - more smoothly boxed and spaced

Lists do not have to be vertical they can be horizontal. Use 'display'.

World Chess Champions - missing commas

This is a list of world chess champions:

Comma separation (like bullets) can be added by hand (labor intensive). You should let CSS do the work by using pseudo classes :after and :before. This is an example of CSS generating content (text, the commas).

World Chess Champions - too many commas

This is a list of world chess champions:

World Chess Champions - just right

This is a list of world chess champions:

Breadcrumbs are the most common use of inline lists. Use the CSS 'content' property to gain additional control over the separators generated by the CSS rules.

Breadcrumbs - no separation (or anchors)
Breadcrumbs - proper separation