- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Selectors
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- 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
CSS - list-style Property
The list-style CSS property is a shorthand property used to set all the list style properties in a single declaration.
Possible Values
Following are the possible values that can be passed to list-style property:
list-style-type: Sets the marker of a list item.
list-style-image: Sets an image as the marker of a list item.
list-style-position: Sets the position of the ::marker relative to the list item.
none: No list style is applied to the list.
The CSS property list-style can list one, two or three keywords in any order, as its value(s). When values list-style-image and list-style-type are passed, the list-style-type acts as a fallback option, in case of list-style-image not supported or unavailable.
Applies to
All the elements with display: list-item.
DOM Syntax
object.style.listStyle = <'list-style-position'> || <'list-style-image'> || <'list-style-type'>
Accessbility concerns: An ordered or unordered list is not recognized by Safari browser as a list, if it has a list-style equal to none. In order to address this intended behavior, you need to add role="list" to the <ol> or <ul> elements.
The pseudo-content that is accessible can restore list semantics.
An empty string or spaces, passed as values to content = "" || " ", will be ignored.
In order to keep these markers, visually hidden, you need to apply an <image> to the list style property.
These workarounds must be used only when there is no solution , and should be checked thoroughly to avoid any unxpected behavior.
CSS list-style - Shorthand
Here is an example of list-style shorthand CSS property:
<html> <head> <style> .circle1 { list-style: circle filled; } .circle2 { list-style: circle; } .square { list-style: square outside none; } </style> </head> <body> <h2>Example - list style shorthand</h2> <ul class="circle1"><u>List style - circle / filled</u> <li>First Item</li> <li>Second Item</li> <li>Third Item</li> </ul> <ul class="circle2"><u>List style - circle</u> <li>First Item</li> <li>Second Item</li> <li>Third Item</li> </ul> <ul class="square"><u>List style - square / outside / none</u> <li>First Item</li> <li>Second Item</li> <li>Third Item</li> </ul> </body> </html>
Following table lists the different longhand properties of list-style:
Property | Description |
---|---|
list-style-image | Adds an image as a list item marker. |
list-style-position | Sets the position of the marker of a list. |
list-style-type | Sets the marker of a list. |
To Continue Learning Please Login
Login with Google