CSS for Poker Players
I’ve just read an excellent explanation of CSS Specificity using a poker analogy and it just makes it so clear to hear it like that. The author covers everything in terms of the basic hands available in a game of poker. This can help explain some of the many mysteries of CSS!
Carl wrote:
Some folks getting on board with CSS tend to get stuck on CSS specificity. The descriptions of which rules override other rules tend to make more sense to programmers than designers, since programmers are used to the concepts of inheritance and overriding properties.
If you’re not from the programming world and CSS seems a bit confusing, perhaps this analogy may help clear some concepts up. Think of CSS rules as poker hands. The best hand determines an element’s style.