5 CSS fouls that I see way too often
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
Five common CSS mistakes that even experienced developers make: (1) Useless declarations like unnecessary `width: 100%` that can cause overflow issues with margins or in flex/grid contexts. (2) Being overly prescriptive with fixed heights instead of using `min-height` or `max-width` to work with browser defaults. (3) Poor code organization and failing to refactor duplicated styles. (4) Removing focus outlines with `outline: none` instead of using `:focus-visible`, which breaks keyboard navigation accessibility. (5) Overusing flexbox or grid when the other layout tool would be more appropriate, a pattern increasingly seen in AI-generated CSS.
Sort: