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

Articles

7946 Articles
{
,

}
Direct link to the article Home

Home

Classic Tricks

Timeless CSS gems

Article on Oct 6, 2021 Scroll Animation Chris Coyier Article on Oct 6, 2021 Yellow Flash Chris Coyier Article on Oct 6, 2021 Self-Drawing Shapes Chris Coyier Article on Oct 6, 2021 Scroll Shadows Chris …
Avatar of Geoff Graham
Geoff Graham on Jun 24, 2024 (Updated on Jun 26, 2024)
Direct link to the article ::view-transition-image-pair
view transitions

::view-transition-image-pair

The CSS ::view-transition-image-pair pseudo-element is part of the View Transitions API that lets us select the “before-and-after” snapshots in a view transition.

::view-transition-image-pair(root) {
  animation-duration: 1s;
}
…
Avatar of Geoff Graham
Geoff Graham on Jun 14, 2024
Direct link to the article ::view-transition-image-new
view transitions

::view-transition-image-new

The CSS ::view-transition-image-new pseudo-element is part of the View Transitions API that lets us select the “new” snapshot that is transitioned to in a view transition.

::view-transition-image-new(*) {
  animation-duration: 700ms;
}
…
Avatar of Geoff Graham
Geoff Graham on Jun 14, 2024 (Updated on Jun 17, 2024)
Direct link to the article ::view-transition-image-old
view transitions

::view-transition-image-old

The CSS ::view-transition-image-old pseudo-element is part of the View Transitions API that lets us select the “before” snapshot in a view transition.

::view-transition-image-old(*) {
  animation-duration: 700ms;
}
…
Avatar of Geoff Graham
Geoff Graham on Jun 14, 2024 (Updated on Jun 17, 2024)
Direct link to the article :popover-open
popover

:popover-open

The CSS :popover-open pseudo-class is part of the Popover API that selects a popover element and styles the popover when it is in its “open” state.

/* Select any open popover */
:popover-open {
  /* Styles */
}

/* Select 
…
Avatar of Geoff Graham
Geoff Graham on Jun 12, 2024
Direct link to the article ::view-transition-group
view transitions

::view-transition-group

The ::view-transition-group pseudo-element selects one or more containers that group the pieces of an individual view transition.

::view-transition-group(transition-name) {
  animation-timing-function: ease-in-out;
}

See that transition-name identifier in the pseudo-element’s argument? That’s how we can select a particular view transition. View …

Avatar of Geoff Graham
Geoff Graham on Jun 12, 2024
Direct link to the article CSS Container Queries
container-queries

CSS Container Queries

The main idea of CSS Container Queries is to register an element as a “container” and apply styles to other elements when the container element meets certain conditions.
Avatar of Geoff Graham
Geoff Graham on Jun 10, 2024 (Updated on Jun 14, 2024)
Direct link to the article ::view-transition
view transitions

::view-transition

The CSS ::view-transition pseudo-element is the top-level — or “root” — containing all animated transitions defined as CSS view transitions on the page.

::view-transition {
  position: fixed;
  inset: 0;
}
…
Avatar of Geoff Graham
Geoff Graham on Jun 7, 2024 (Updated on Jun 10, 2024)
Direct link to the article :defined
web components

:defined

The :defined pseudo-class selector is part of CSS Selectors Level 4 specification allowing you to target custom elements created with the Web Components API and defined in JavaScript. Also, this selector matches any standard element built into the browser.…

Avatar of Mojtaba Seyedi
Mojtaba Seyedi on Jun 5, 2024 (Updated on Jun 7, 2024)
Direct link to the article ::details-content
details

::details-content

The CSS ::details-content pseudo-element provides a way to select and apply styles to the inner parts of a <details> element without leaking styles to the <summary>.

details::details-content {
  background-color: hsl(0 0% 0%);
}
Syntax
<element-selector::details-content {}

We say …

Avatar of Geoff Graham
Geoff Graham on Jun 5, 2024
Direct link to the article CSS Length Units
container units units

CSS Length Units

A comprehensive guide covering nine types of lengths that CSS uses to size elements in terms of dimensions, space, time, and even sound.
Avatar of Geoff Graham
Geoff Graham on Jun 3, 2024 (Updated on Jun 18, 2024)
  • Newer
  • 1
  • 2
  • 3
  • ...
  • 723
  • 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