Round the corners of outline?

user1537415 picture user1537415 · Aug 2, 2012 · Viewed 13.9k times · Source

So I have these four boxes, floated left, each with a 50% width of the page. I want them to have an outline of 1px solid gray, and I want to round the corners with 6px. I know I could use border:1px solid gray; and border-radius:6px; but the problem is that border adds width to the element. And because the boxes have 50% width, and they're floated left, I can't add a border to them. So is it possible to make outline corners round?

Edit:CSS-only solution would be best, because I need to support every browser excluding IE6.

Answer

kapex picture kapex · Aug 2, 2012

You can still do this with borders by using box-sizing. It includes the border's width in the elements total width and is fairly supported.