Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
Search

Articles Tagged
lists

16 Articles
{
,

}
Direct link to the article Remove List Markers Without Affecting Semantics
list-style-type lists

Remove List Markers Without Affecting Semantics

:where(ul, li, menu) {
  list-style: "";
}

The more “correct” approach is to set list-style to none but that has a latent consequence of Safari no longer recognizing the element as a proper list, semantically speaking. We could fix …

Avatar of Geoff Graham
Geoff Graham on Jan 15, 2024 (Updated on May 22, 2024)
List item with bullet marker. A double-sided arrow occupies the space between the marker and the text.
Direct link to the article Everything You Need to Know About the Gap After the List Marker
list-style lists marker

Everything You Need to Know About the Gap After the List Marker

I was reading “Creative List Styling” on Google’s web.dev blog and noticed something odd in one of the code examples in the ::marker section of the article. The built-in list markers are bullets, ordinal numbers, and letters. The ::marker pseudo-element …

Avatar of Šime Vidas
Šime Vidas on Mar 2, 2023 (Updated on May 17, 2024)
Direct link to the article Newer Things to Know About Good Ol’ HTML Lists
aria definition list list-style-position lists marker menu

Newer Things to Know About Good Ol’ HTML Lists

HTML lists are boring. They don’t do much, so we don’t really think about them despite how widely used they are. And we’re still able to do the same things we’ve always done to customize them, like removing markers, reversing …

Avatar of Daniel Schwarz
Daniel Schwarz on Nov 28, 2022
Direct link to the article A Perfect Table of Contents With HTML + CSS
lists

A Perfect Table of Contents With HTML + CSS

Earlier this year, I self-published an ebook called Understanding JavaScript Promises (free for download). Even though I didn’t have any intention of turning it into a print book, enough people reached out inquiring about a print version that …

Avatar of Nicholas C. Zakas
Nicholas C. Zakas on May 25, 2022
Direct link to the article CSS Pseudo Commas
copywriting lists nth-child pseudo elements

CSS Pseudo Commas

A bonafide CSS trick if there ever was one! @ShadowShahriar created a CodePen demo that uses pseudo-elements to place commas between list items that are displayed inline, and the result is a natural-looking complete sentence with proper punctuation.…

Avatar of Geoff Graham
Geoff Graham on Aug 30, 2021 (Updated on Sep 27, 2021)
Direct link to the article List Markers and String Styles
list-style list-style-type lists marker

List Markers and String Styles

Lists—we’ve all worked with them in one form or another. I’m talking about HTML’s <ol> and <ul>. Much of the time, because we desire styling control, we turn off the list’s markers completely with list-style-type: none, and start …

Avatar of Eric Meyer
Eric Meyer on Apr 29, 2021
Direct link to the article How to Make a List Component with Emotion
components emotion lists

How to Make a List Component with Emotion

I’ve been doing a bit of refactoring this week at Sentry and I noticed that we didn’t have a generic List component that we could use across projects and features. So, I started one, but here’s the rub: we style …

Avatar of Robin Rendle
Robin Rendle on Jul 8, 2020
Direct link to the article How to Reverse CSS Custom Counters
counter-increment counters lists

How to Reverse CSS Custom Counters

I needed a numbered list of blog posts to be listed with the last/high first and going down from there. Like this:

5. Post Title
4. Post Title
3. Post Title
2. Post Title
1. Post Title

But the above …

Avatar of Etinosa Obaseki
Etinosa Obaseki on Jun 11, 2020
Direct link to the article Did You Know the Ordered List Element Has Start and Reversed Attributes?
lists

Did You Know the Ordered List Element Has Start and Reversed Attributes?

I sure didn’t! Tomek Sułkowsi shows how we can reverse the numbering of ordered lists with a simple HTML attribute:…

Avatar of Robin Rendle
Robin Rendle on Mar 24, 2020
Direct link to the article Finally, it Will Be Easy to Change the Color of List Bullets
lists

Finally, it Will Be Easy to Change the Color of List Bullets

In my germinating years, the general advice was this:

<ul>
  <li><span>List item</span></li>
  <!-- ... -->
</ul>
li { color: red; } /* bullet */
li span { color: black; } /* text */

Not terrible, but not great. You’re “resetting” …

Avatar of Chris Coyier
Chris Coyier on Nov 14, 2019 (Updated on Dec 19, 2019)
Direct link to the article Rendering Lists Using React Virtualized
beginning react lists react

Rendering Lists Using React Virtualized

Working with data in React is relatively easy because React is designed to handle data as state. The hassle begins when the amount of data you need to consume becomes massive. For example, say you have to handle a dataset …

Avatar of Kingsley Silas
Kingsley Silas on Dec 13, 2018
  • 1
  • 2
  • Older

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways hosting
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Write for us!
  • Advertise with us
  • Contact us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • X
Back to Top