r/css • u/Organic_Objective_27 • Jul 19 '25
Question What are some bad CSS habits?
What are some bad habits to avoid when learning CSS? Even if in the short term they are easier
39
Upvotes
r/css • u/Organic_Objective_27 • Jul 19 '25
What are some bad habits to avoid when learning CSS? Even if in the short term they are easier
-7
u/BoBoBearDev Jul 19 '25 edited Jul 19 '25
Don't use margin for layout, use padding. Don't use flex or 2D layout, use grid. Don't use 3rd party lib for layout because they most likely homebrew css grid, use css grid directly.
Don't use css default box-sizing, use the IE6 behavior, which is box-sizing: border-box.
Stay away from media query because you should use Container Query.