Академический Документы
Профессиональный Документы
Культура Документы
HOME
HTML
CSS
JAVASCRIPT
SQL
PHP
JQUERY
XML
ASP.NET
MORE...
REFERENCES
EXAMPLES
FORUM
Search w3schools.com
CSS Tutorial
CSS HOME
CSS Introduction
Select Language
CSS Syntax
CSS Selectors
CSS How To
CSS Backgrounds
WEB HOSTING
CSS Lists
UK Reseller Host
cPanel Hosting
CSS Text
CSS Fonts
CSS Links
CSS Lists
Previous
Next Chapter
CSS Tables
CSS Positioning
CSS Floating
CSS Align
W3SCHOOLS EXA
List
CSS Display
WEB BUILDING
SHARE THIS PA
With CSS, lists can be styled further, and images can be used as the list item marker.
CSS Combinators
CSS Pseudo-class
CSS Pseudo-element
CSS Navigation Bar
CSS3 Tutorial
CSS3 Introduction
CSS3 Borders
CSS3 Backgrounds
CSS3 Gradients
CSS3 Text Effects
Example
ul.a {
list-style-type: circle;
}
ul.b {
list-style-type: square;
}
ol.c {
list-style-type: upper-roman;
}
CSS3 Fonts
CSS3 2D Transforms
CSS3 3D Transforms
CSS3 Transitions
CSS3 Animations
CSS3 Multiple Columns
ol.d {
list-style-type: lower-alpha;
}
Try it yourself
Some of the values are for unordered lists, and some for ordered lists.
CSS Examples
CSS Examples
CSS Quiz
To specify an image as the list item marker, use the list-style-image property:
CSS Certificate
CSS References
CSS Reference
CSS Selectors
CSS Reference Aural
CSS Web Safe Fonts
CSS Units
Example
ul {
list-style-image: url('sqpurple.gif');
}
WEB RESOURC
Web Statistics
Web Validation
Try it yourself
CSS Colors
CSS Color Names
The example above does not display equally in all browsers. IE and Opera will display the image-marker a little bit higher
than Firefox, Chrome, and Safari.
If you want the image-marker to be placed equally in all browsers, a crossbrowser solution is explained below.
Crossbrowser Solution
The following example displays the image-marker equally in all browsers:
Example
http://www.w3schools.com/css/css_list.asp
1/3
7/21/2014
Example explained:
For ul:
Set the list-style-type to none to remove the list item marker
Set both padding and margin to 0px (for cross-browser compatibility)
For all li in ul:
Set the URL of the image, and show it only once (no-repeat)
Position the image where you want it (left 0px and down 5px)
Position the text in the list with padding-left
Example
ul {
list-style: square url("sqpurple.gif");
}
Try it yourself
When using the shorthand property, the order of the values are:
list-style-type
list-style-position (for a description, see the CSS properties table below)
list-style-image
It does not matter if one of the values above are missing, as long as the rest are in the specified order.
More Examples
All the different list-item markers for lists
This example demonstrates all the different list-item markers in CSS.
Description
list-style
list-style-image
list-style-position
Specifies if the list-item markers should appear inside or outside the content flow
list-style-type
Previous
http://www.w3schools.com/css/css_list.asp
Next Chapter
2/3
7/21/2014
Top 10 Tutorials
Top 10 References
Top 10 Examples
Web Certificates
HTML Tutorial
HTML5 Tutorial
C SS Tutorial
C SS3 Tutorial
JavaScript Tutorial
jQuery Tutorial
SQL Tutorial
PHP Tutorial
ASP.NET Tutorial
XML Tutorial
HTML/HTML5 Reference
C SS 1,2,3 Reference
C SS 3 Browser Support
JavaScript
HTML DOM
XML DOM
PHP Reference
jQuery Reference
ASP.NET Reference
HTML C olors
HTML Examples
C SS Examples
JavaScript Examples
HTML DOM Examples
PHP Examples
jQuery Examples
XML Examples
XML DOM Examples
ASP Examples
SVG Examples
R EPO R T ER R O R
HO ME |
TO P
Color Picker
HTML C ertificate
HTML5 C ertificate
C SS C ertificate
JavaScript C ertificate
jQuery C ertificate
PHP C ertificate
XML C ertificate
ASP C ertificate
PR INT
FO R UM
ABO UT
W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples
are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use,
cookie and privacy policy. C opyright 1999-2014 by Refsnes Data. All Rights Reserved.
http://www.w3schools.com/css/css_list.asp
3/3