Hacker News new | past | comments | ask | show | jobs | submit login

The real issue with which one "seems right" in some sort of intuitive sense is that it varies with what I'm doing. If I'm sizing something that is fundamentally a container, then I care about the size of the whole box, including padding (and probably also border), for all the reasons that the pro-ie-box-model people have said.

On the other hand, if what I'm sizing is something that is fundamentally content, then it's the W3C box model that seems more appropriate. "I want this paragraph to be 25em wide" probably means you actually want 25em worth of width actually dedicated to the letters themselves. "Scale this image to 320px width" makes a lot of sense if the image is natively some multiple of 320 pixels wide, and if the actual width the image itself gets is only 314 pixels due to border and padding, well, your image quality degrades.

The really-right solution is to be able to say "assume this box model for certain types of elements, and assume this other box model for other types of elements, and also let me override it on a per-element basis." Which the new CSS lets you do. Win!




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: