Tuesday 7, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

CSS Lists

Lists come in two basic flavors: unordered and ordered. However, CSS allows for more list customization than HTML -- to the extent that even images can be used as bullet points for unordered lists!

If you want to use something different from the default numbering of ordered lists, or the bullets/discs of unordered lists, then all you have to do is choose a different style for your lists. CSS allows you to select from a wide variety of different list item shapes.
• Unordered list styles: square, circle, disc (default), and none
• Ordered list styles: upper-alpha, lower-alpha, upper-roman, lower-roman, decimal (default), and none
Example:
ol { list-style-type: upper-roman; }
ul { list-style-type: circle; }

Here is an ordered list:
• This list is
• using roman
• numerals
• with CSS!
and now an unordered list:
1. This list is
2. using circle types
3. with CSS!
CSS Lists With Images
As we stated in the introduction, CSS lists allow you to insert an image in place of the normal bullets. A good choice for a bullet image would one that is smaller than the height of your text and is a relatively simple/plain graphic.
Example:
ul { list-style-image: url("listArrow.gif"); }
ol { list-style-image: url("listArrow2.gif"); }

Here is an unordered list:
• This list is
• using a picture with CSS!
and now an ordered list:
1. This list is
2. using a picture
3. with CSS!
As you can see, it does not matter if the lists are

    or
      when using images. Nevertheless, it is a good coding practice to only use images for an unordered list. Ordered lists usually have an incremented (growing) value that appears next to each list item and you can't do this with just one image.
      CSS List Position
      With CSS, it is possible to alter the indentation that takes place with your list items. See the example below for the trick of indenting your lists.
      Example:
      ul { list-style-position: inside; }
      ol { list-style-position: outside; }

       

      • This list is
      • using inside
      • positioning with CSS!
      and now an ordered list:
      1. This list is
      2. using outside
      3. positioning with CSS!
      Note: "Outside" is actually the default setting for indentation.
      List: All in One
      It is possible to combine the above CSS techniques into one line of CSS. This is useful if you would like to have a list-style-type take the place of your list image, if the image is not able to be loaded.

      Example:
      ul { list-style: upper-roman inside url("http://www.example.com/notHere.gif");}

      • This list's image did
      • NOT load correctly
      • But because we chose to include
      • A CSS list type, we avoided a bland list!

       

 
     
   
CSS Tutorial
 
  Introduction
Introduction
  Syntax
Syntax
  Internal CSS
Internal CSS
  External CSS
External CSS
  Inline CSS
Inline CSS
  CSS Classes
CSS Classes
  CSS Background
CSS Background
  CSS Text
CSS Text
  CSS Font
CSS Font
  CSS Border
CSS Border
  CSS Outline
CSS Outline
  CSS Padding
CSS Padding
  CSS Margin
CSS Margin
  CSS Lists
CSS Lists
  CSS Tables
CSS Tables
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download Freebie guide Ebook Freebie guide
   
Download Design and Analysis of Algorithms: Course Notes  Ebook Design and Analysis of Algorithms: Course Notes
   
Download Learning GNU C  Ebook Learning GNU C
   
Download Enhance Your Financial Intelligence Ebook Enhance Your Financial Intelligence
   
Download Creating Wealth Boot Camp Ebook Creating Wealth Boot Camp
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz