- 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-image
The list-style-image CSS property is used to add an image as a list item marker.
Syntax
The CSS property list-style-image can have different values. Let's check all the possible available syntax to set a value for list-style-image.
Keyword value
list-style-image: none;
URL value
list-style-image: url("<filename>");
Valid image value
list-style-image: linear-gradient(to left bottom, red, blue);
Global values
list-style-image: inherit; list-style-image: initial; list-style-image: revert; list-style-image: revert-layer; list-style-image: unset;
Possible Values
<image>: An image used as a marker.
none: No image used as a marker. Value set for list-style-type will be used, in case the list-style-image is set to none.
Applies to
List items. Elements such as <li> and <summary>, along with all the elements that have display: list-item.
DOM Syntax
object.style.listStyleImage = url('<filename>')
CSS list-style-image - Basic example
Here is an example of list-style-image CSS property with a valid URL for ordered and unordered lists:
<html> <head> <style> .type-url-unordered { list-style-image: url('images/smiley.png'); } .type-url-ordered { list-style-image: url('images/smiley.png'); } </style> </head> <body> <h2>Example - list-style-image</h2> <ul class="type-url-unordered"><u>List style image</u> <li>First Item: <ul> <li>Sub-item 1</li> <li>Sub-item 2</li> </ul> </li> <li>Second Item</li> <li>Third Item</li> </ul> <ol class="type-url-ordered"><u>List style image</u> <li>First Item</li> <li>Second Item</li> <li>Third Item</li> </ol> </body> </html>
CSS list-style-image - Using linear-gradient()
Here is an example of list-style-image CSS property with a linear-gradient() value passed to it:
<html> <head> <style> .type-gradient { list-style-image: linear-gradient(to left bottom, red, orange, yellow, lightyellow, blue, magenta, purple); } </style> </head> <body> <h2>list-style-image: linear-gradient()</h2> <ul class="type-gradient"><u>List style image</u> <li>First Item: <ul> <li>Sub-item 1</li> <li>Sub-item 2</li> </ul> </li> <li>Second Item</li> <li>Third Item</li> </ul> </body> </html>
CSS list-style-image - Using 'none'
Here is an example of list-style-image: none CSS property:
<html> <head> <style> .type-image-none { list-style-image: none; } </style> </head> <body> <h2>list-style-image: none</h2> <ul class="type-image-none"><u>List style image - none</u> <li>First Item: <ul> <li>Sub-item 1</li> <li>Sub-item 2</li> </ul> </li> <li>Second Item</li> <li>Third Item</li> </ul> </body> </html>
Advertisements
To Continue Learning Please Login
Login with Google