{"id":339298,"date":"2021-04-29T07:32:41","date_gmt":"2021-04-29T14:32:41","guid":{"rendered":"https:\/\/css-tricks.com\/?p=339298"},"modified":"2021-04-29T07:32:44","modified_gmt":"2021-04-29T14:32:44","slug":"list-markers-and-string-styles","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/list-markers-and-string-styles\/","title":{"rendered":"List Markers and String Styles"},"content":{"rendered":"\n
Lists\u2014we\u2019ve all worked with them in one form or another. I\u2019m talking about HTML\u2019s But what if we want to style the markers differently than the contents of the list items? That\u2019s always been difficult at best. Now, thanks to the Consider this list:<\/p>\n\n\n\n<ol><\/code> and
<ul><\/code>. Much of the time, because we desire styling control, we turn off the list\u2019s markers completely with
list-style-type: none<\/code>, and start styling from there. Other times, we choose from a very limited set of unordered list markers, such as
disc<\/code>,
circle<\/code>, or
square<\/code>; or a (much<\/a>) wider range of ordered list markers. We might even, from time to time, supply the URL of an image to be used.<\/p>\n\n\n\n\n\n\n\n
::marker<\/code> pseudo-element, it\u2019s a whole lot easier. You don\u2019t get the full range of CSS to apply to the markers, but there\u2019s still a great deal that can be done.<\/p>\n\n\n\n
::marker<\/code> is available in Firefox and, thanks to work by Igalia, Chrome as well.<\/p>\n\n\n\n