When I am coming to the point of styling lists, I find myself unsure of the difference between list-style
and list-style-type
. Are they the same?
The list-style-type CSS property sets the marker (such as a disc, character, or custom counter style) of a list item element.
The list-style-type property defines the type of list by setting the content of each marker, or bullet, on the list. Acceptable keyword values for list-style-type include: disc. circle.
In HTML, there are two main types of lists: unordered lists (<ul>) - the list items are marked with bullets. ordered lists (<ol>) - the list items are marked with numbers or letters.
The default list-style-type value for an ordered list is decimal , whereas the default for an unordered list is disc . Accepted values for the list-style-type property include: Unordered: disc (default)
From www.w3schools.com :
"The list-style shorthand property sets all the list properties in one declaration."
and here
"The list-style-type specifies the type of list-item marker in a list."
list-style
is the shorthand to set list-style-type
, list-style-position
and list-style-image
properties all in one declaration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With