
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
Formatting Unordered and Ordered Lists in CSS
The style and position of unordered and ordered lists can be formatted by CSS properties with list-style-type, list-style-image and list-style-position.
Syntax
The syntax of CSS list-style property is as follows −
Selector { list-style: /*value*/ }
Example
The following examples illustrate CSS list-style property −
The following example styles ordered list −
<!DOCTYPE html> <html> <head> <style> ol { list-style: upper-roman; line-height: 150%; } </style> </head> <body> <h2>Latest C# Versions</h2> <ol> <li>C# 8.0</li> <li>C# 7.3</li> <li>C# 7.2</li> <li>C# 7.1</li> <li>C# 7.0</li> </ol> </body> </html>
Output
This gives the following output −
Example
The following example styles unordered list −
<!DOCTYPE html> <html> <head> <style> ul > ul{ list-style: circle inside; } li:last-child { list-style-type: square; } </style> </head> <body> <h2>Programming Languages</h2> <ul> <li>C++ programming language created by Bjarne Stroustrup as an extension of the C programming language.</li> <li>Java programming language developed by James Gosling.</li> <ul> <li>Core Java</li> <li>Advanced Java</li> </ul> <li>Scala is a modern multi-paradigm programming language designed to express common programming patterns in a concise, elegant, and type-safe way.</li> </ul> </body> </html>
Output
This gives the following output −
- Related Articles
- Formatting Unordered and Ordered Lists Using CSS
- Style unordered lists markers with CSS
- What is the difference between ordered factors and unordered factors in R?
- Formatting Text in CSS
- Understanding CSS Visual Formatting
- CSS Visual Formatting Model
- Formatting Text Using CSS
- Styling Lists in CSS
- Control the flow and formatting of text with CSS
- Styling Lists with CSS
- How to create an unordered list without bullets using CSS?
- Style the numbering characters in an ordered list with CSS
- How to Animate Bullets in Lists using CSS
- How to change bullet colors for lists with CSS?
- Change Bullet Color for Lists with ::marker CSS Selector

Advertisements