Tag Archives: CSS3

CSS Bug: box-sizing and min-height

, , ,

One thing I’ve (fairly) recently discovered (courtesy of Paul Irish) is the use of box-sizing in CSS3. This little nugget of CSS joy allows you to set element dimensions regardless of padding and borders. In some situations, this is invaluable. For example: say you want to have a container that’s 100% wide but has padding of 20px around the edges. Without knowing what the size of the screen is, you can only do this via javascript or by creating a wrapping container, both of which are annoying. With box-sizing, you can set the padding to whatever you want and it’ll still size perfectly to 100%. Wonderful! Isn’t it?

Read More »