I have the following code: http://www.designated.net.au/testbed/test/
body {
margin:0;
padding:0;
width:100%;
height:100%;
background: #000000;
}
#page {
margin:0% 10% 0% 10%;
width:80%;
height:1000px;
border:solid #333333;
border: 0 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
}
As far as I know that should give me an inner border on the left and right of 10px, but instead I get a border inside the whole thing of about 2px.
Any ideas?
Fixed for me in Chrome, Safari, IE 7/8/9: http://jsfiddle.net/XsNck/
I believe your border declaration syntax was incorrect.
Not Working
Working
From the spec:
See also: https://developer.mozilla.org/en-US/docs/CSS/border-style
Incidentally (in light of the question title), this isn’t directly related to the
box-sizingproperty;box-sizingcontrols how the dimensions of a box are calculated (specifically, whether or not to include padding and borders). It doesn’t change the border size.