• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4320 shaares
Filters

My CSS selector strategy  •  Stuff & Nonsense

QRCode
  • Element selectors keep styles as global as possible

  • ID selectors identify things (one per page)

  • Class selectors classify things
    Quite often, I’ll style those child elements using a descendant selector:

    # video > p
  • Attribute selectors vary things

    .layout { […] }
    [data-layout="bartok"] { […] }
https://stuffandnonsense.co.uk/blog/my-css-selector-strategy
December 17, 2025 at 1:27:56 PM EST *
css webdesign
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community