Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
Search

Articles Tagged
data attributes

4 Articles
Direct link to the article Don’t Fight the Cascade, Control It!
:is :where cascade cascade layers custom properties data attributes specificity

Don’t Fight the Cascade, Control It!

If you’re disciplined and make use of the inheritance that the CSS cascade provides, you’ll end up writing less CSS. But because our styles often comes from all kinds of sources — and can be a pain to structure and …

Mads Stoumann on Jan 11, 2022
Direct link to the article HTML Data Attributes Guide
attribute selectors attributes data attributes HTML

HTML Data Attributes Guide

Everything you ever wanted to know about data attributes in HTML, CSS, and JavaScript.
Chris Coyier on Aug 12, 2024
Direct link to the article Working with Attributes on DOM Elements
attributes data attributes JavaScript

Working with Attributes on DOM Elements

The DOM is just a little weird about some things, and the way you deal with attributes is no exception. There are a number of ways to deal with the attributes on elements. By attributes, I mean things like the …

Chris Coyier on Sep 3, 2019
Direct link to the article Styling Based on Scroll Position
attribute selectors data attributes debounce JavaScript scrolling

Styling Based on Scroll Position

Rik Schennink documents a system for being able to write CSS selectors that style a page when it has scrolled to a certain point. If you’re like me, you’re already on the lookout for document.addEventListener('scroll' ... and being terrified about …

Chris Coyier on Jan 30, 2020

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

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