CSS Fundamentals — Trivia & Interesting Facts¶
Surprising, historical, and little-known facts about CSS fundamentals.
CSS was proposed in 1994 and took 3 years of browser wars to become standard¶
Hakon Wium Lie proposed Cascading Style Sheets in October 1994 while working at CERN with Tim Berners-Lee. The first browser to fully support CSS1 was Internet Explorer 5 for Mac in March 2000 — over five years after the proposal. The delay was caused partly by Netscape's preference for JavaScript-based styling, which lost out to CSS in the standards process.
The "C" in CSS is its most revolutionary feature¶
The "cascading" mechanism — where multiple style rules can apply to the same element with a defined priority order — was Lie's key innovation. Before CSS, every styling decision had to be made by either the page author or the browser. The cascade created a negotiation system between author styles, user styles, and browser defaults that was unprecedented in document formatting.
z-index has caused more developer confusion than almost any other CSS property¶
The z-index property only works on positioned elements (relative, absolute, fixed, or sticky), and it creates "stacking contexts" that isolate z-index values from parent contexts. This interaction is so confusing that a 2019 State of CSS survey ranked z-index as the second most frustrating CSS feature, behind only browser inconsistencies.
CSS specificity follows a four-category scoring system, not a decimal one¶
Specificity is calculated as (inline, IDs, classes/attributes/pseudo-classes, elements/pseudo-elements). A common misconception is that 11 classes beats 1 ID, but they don't — specificity categories never overflow into each other. One ID selector (0,1,0,0) always beats any number of class selectors (0,0,n,0). This was clarified in the CSS2 specification but continues to surprise developers.
The !important declaration was designed for accessibility, not overrides¶
The !important rule was originally intended to let users with disabilities override author styles — for example, forcing larger fonts or higher contrast. In practice, it became a developer shortcut for winning specificity battles, leading to "specificity wars" in large codebases where multiple !important declarations compete against each other.
Flexbox took 9 years from proposal to cross-browser support¶
The first Flexbox specification was published in 2009, but it went through three major syntax revisions (2009, 2011, 2012) before reaching broad cross-browser support around 2015-2017. During this period, developers had to write three different syntaxes with vendor prefixes to support all browsers. CSS Grid, proposed in 2011 by Microsoft, reached cross-browser support faster thanks to lessons learned from Flexbox.
CSS can compute — it's technically Turing complete¶
Researchers have demonstrated that CSS3, combined with HTML's checkbox hack (using :checked pseudo-class and sibling selectors), is Turing complete. People have built working implementations of Rule 110 cellular automata in pure CSS, and functional (if impractical) calculators, games, and state machines without a single line of JavaScript.