Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
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 …

Avatar of Mads Stoumann
Mads Stoumann on Jan 10, 2022 (Updated on Jan 11, 2022)
Direct link to the article A Complete Guide to Data Attributes
attribute selectors attributes data attributes HTML

A Complete Guide to Data Attributes

Everything you ever wanted to know about data attributes in HTML, CSS, and JavaScript.
Avatar of Chris Coyier
Chris Coyier on Feb 17, 2020 (Updated on Jun 13, 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 …

Avatar of Chris Coyier
Chris Coyier on Aug 30, 2019 (Updated 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 …

Avatar of Chris Coyier
Chris Coyier on Mar 7, 2019 (Updated 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 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