I want to know how can I achieve an arithmetic operation in CSS.
For example: I want to align two divs side by side each having width of 50% and I w
Use box-sizing: border-box; on your Paul Irish comments on the use of box-sizing is content-box, which does not include padding or border in the width attribute.
#container {
border: 1px solid black;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 50%;
}
calc() and suggests using border-box because it better matches our mental model of "width".