Skip to main content
CSS-Tricks
Since 2007
  • Articles
  • Guides
  • Almanac
  • Links
  • Picks
  • Newsletter
  • Search

Articles Tagged
pseudo elements

25 Articles
{
,

}
Direct link to the article Let’s Use the Nonexistent ::nth-letter Selector Now
pseudo elements

Let’s Use the Nonexistent ::nth-letter Selector Now

My shim might give the powers that be another reason to say native support isn't necessary, or if lots of people use my :nth-letter hack in the wild, the browser gods might recognize the need to implement it for real.
Lee Meyer on Apr 27, 2026
Direct link to the article Quick Hit #122
CSS JavaScript pseudo elements view transitions

Quick Hit #122

Chrome 147 becomes the first to implement the CSSPseudoElement JavaScript interface, and allow the startViewTransition() method to be called on specific elements.…

Daniel Schwarz on Apr 13, 2026
A calendar month layout with the dates 9-29 selected. 9 and 19 have a dark blue background and the dates between are light blue.
Direct link to the article Selecting a Date Range in CSS
nth-child pseudo elements

Selecting a Date Range in CSS

A clever approach for selecting multiple dates on a calendar where the :nth-child()'s “n of selector” syntax does all the heavy lifting... even in the JavaScript.
Preethi on Apr 9, 2026
A selected portion of the words premier league highlights showing the highlights styled in a variety of overlapping colors.
Direct link to the article Styling ::search-text and Other Highlight-y Pseudo-Elements
pseudo elements

Styling ::search-text and Other Highlight-y Pseudo-Elements

The new ::search-text pseudo (Chrome 144) matches are yellow while the current target (::search-text:current) is orange, but ::search-text enables us to change that.
Daniel Schwarz on Jan 28, 2026
Direct link to the article Quick Hit #85
chrome CSS pseudo elements

Quick Hit #85

Chrome 144 becomes the first to support ::search-text, a pseudo-element for selecting find-in-page text.…

Daniel Schwarz on Jan 16, 2026
Direct link to the article Creating Animated, Clickable Cards With the :has() Relational Pseudo Class
:has pseudo elements

Creating Animated, Clickable Cards With the :has() Relational Pseudo Class

The CSS :has() pseudo class is rolling out in many browsers with Chrome and Safari already fully supporting it. It’s often referred to it as “the parent selector” — as in, we can select style a parent element from a …

Brecht De Ruyte on Oct 25, 2022
Direct link to the article Single Element Loaders: The Bars
css animation gradients loader pseudo elements transform

Single Element Loaders: The Bars

We’ve looked at spinners. We’ve looked at dots. Now we’re going to tackle another common pattern for loaders: bars. And we’re going to do the same thing in this third article of the series as we have the others …

Temani Afif on Jun 24, 2022
Direct link to the article Conditionally Styling Selected Elements in a Grid Container
grid nth-child pseudo elements

Conditionally Styling Selected Elements in a Grid Container

Calendars, shopping carts, galleries, file explorers, and online libraries are some situations where selectable items are shown in grids (i.e. square lattices). You know, even those security checks that ask you to select all images with crosswalks or whatever.…

Preethi on Jun 15, 2022
Direct link to the article Single Element Loaders: The Spinner
animation gradients loader mask pseudo elements

Single Element Loaders: The Spinner

Making CSS-only loaders is one of my favorite tasks. It’s always satisfying to look at those infinite animations. And, of course, there are lots of techniques and approaches to make them — no need to look further than CodePen to …

Temani Afif on Jun 10, 2022
  • 1
  • 2
  • 3
  • Older

CSS-Tricks is powered by DigitalOcean.

Get Curated Front-End Roundups Right in Your Inbox

Coming back really, really soon! See past issues →

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top
✕

Wait! Don't Go Yet 🚀

Get our FREE eBook "10 Programming Tips That Changed Everything" when you subscribe!

No spam. Unsubscribe anytime.