The Mistakes Of CSS | CSS-Tricks
CSS-Tricks
·
Jan 30, 2025
·
article
Surely you have seen a CSS property and thought “Why?” For example:
> Why doesn’t `z-index` work on all elements, and why is it “-`index`” anyways?
Or:
> Why do we need `interpolate-size` to animate to `auto`?
You are not alone. CSS was born in 1996 (it can legally order a beer, you know!) and was initially considered a way to style documents; I don’t think anyone imagined everything CSS would be expected to do nearly 30 years later. If we had a time machine, many things would be done differently to match conventions or to make more sense. Heck, even the CSS Working Group admits to wanting a time-traveling contraption… in the specifications!
> **NOTE:** If we had a time machine, this property wouldn’t need to exist.
>
> CSS Values and Units Module Level 5, [Section 10.4](https://drafts.csswg.org/css-values-5/#interpolate-size)
If by some stroke of opportunity, I was given free rein to rename some things in CSS, a couple of ideas come to mind, but if you want more, you can find an ongoing list of mistakes made in CSS… by the CSS Working Group! Take, for example, `background-repeat`:
> Not quite a mistake, because it was a reasonable default for the 90s, but it would be more helpful since then if `background-repeat` defaulted to `no-repeat`.
Right now, people are questioning if [CSS Flexbox and CSS Grid should share more syntax](https://github.com/w3c/csswg-drafts/issues/11243) in light of the upcoming [CSS Masonry layout specifications](https://css-tricks.com/css-masonry-css-grid/).
Why not fix them? Sadly, it isn’t as easy as _fixing_ something. People already built their websites with these quirks in mind, and changing them would break those sites. Consider it [technical debt](https://css-tricks.com/defining-and-dealing-with-technical-debt/).
This is why I think the CSS Working Group deserves an onslaught of praise. Designing new features that are immutable once shipped has to be a nerve-wracking experience that involves inexact science. It’s not that we haven’t seen the specifications change or evolve in the past — they most certainly have — but the value of getting things right the first time is a beast of burden.
---
[The Mistakes of CSS](https://css-tricks.com/the-mistakes-of-css/) originally published on [CSS-Tricks](https://css-tricks.com), which is part of the [DigitalOcean](https://try.digitalocean.com/css-tricks/?utm%5Fmedium=rss&utm%5Fsource=css-tricks.com&utm%5Fcampaign=family%5F&utm%5Fcontent=) family. You should [get the newsletter](https://css-tricks.com/newsletters/).
https://css-tricks.com/the-mistakes-of-css/