Comment

Comment by ollerac

I ran into so many issues with content-box a decade back I never thought about it again and always defaulted to border-box.

I think it's absurd that I can set a div to a specific width (100px, 200px, whatever) and the padding or border will make the div larger than that width.

It makes it so hard to think about designing a page when you have to continuously add together padding, margin, and border with the width to get the actual width.

You're right about flexbox and grid solving most of these issues -- and responsive design has pretty much done away with using exact pixel widths for anything, but I still run into some cases (especially around creating grid layouts that automatically reflow) where CSS columns and floats are the best approach (not often, but it still happens...) and then you need to rely on the width being the actual width, you know?

parent ollerac 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton