View Single Post
Old 09-06-2024, 01:28 PM   #12
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 479
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by enuddleyarbl View Post
Order of precedence for CSS falls under "specificity" (and trying to understand the rules hurts my brain). Here's a blurb on them:

https://www.w3schools.com/css/css_specificity.asp

Roughly, the order of precedence from highest to lowest is:
Inline styles - Example: <h1 style="color: pink;">
IDs - Example: #navbar
Classes, pseudo-classes, attribute selectors - Example: .test, :hover, [href]
Elements and pseudo-elements - Example: h1, ::before

Also, if all else is equal, the last selector defined wins.
I can see why that would hurt your brain.

I guess re-reading, playing and more practice are the way to go.
foosion is offline   Reply With Quote