I fear that calc will continue to be of limited value until we can say calc(#bar(width) -3em); and know that will work. So the width is one orange item + one grey span or 200px + (100% - 860px) / 6. So that when the browser window is 1000px wide, the div's height and width are both 500px. The biggest thing it allows you to do is mix percentage and absolute values as well as mix sizing units. This can be done using a unit were all familiar with: percentages..sidebar { width: 25% } Lets set the height equal to the viewport. The biggest problem with calc() right now is that it is not well supported. Me trying to figure out a solution to a CSS issue. Let's say I've got a div that has a width of 50% of the body. Centering Percentage Width/Height Elements ... but margins are based on width ... top:calc(50% 50px/2); /* 50% height/2 / Negative values like height: -100px are not accepted. After that, I will say that the main container div should be full width (100%) minus 40px and aligned horizontally in the middle of the viewport: .wrapper { width: 1024px; /* Fallback for browsers that don't support the calc() function */ width: -moz-calc(100% - 40px); width: calc(100% - 40px); margin: auto; }. div#main { width: calc(100% - 100px); height: calc(100% - 50px); } if(! Means that the browser calculates the height and width), or be specified in length values, like px, cm, etc., or in percent (%) of the containing block. The content area is defined as the padding, border, and margin of the element. Negative values like height: -100px are not accepted. Setting height and width. And the middle cells have two grey spans so their width is one orange item + two grey spans or 200px + ((100% - 860X) / 6) * 2. The height property in CSS defines specifies the content height of boxes and accepts any of the length values. Responsive Aspect Ratios With Pure As you can see in the CSS, all we have to do is nest an element with 100% width inside a responsive percentage-based-width parent element, and then [] Responsive Css | Home February 8, 2016 Reply CSS3 height: calc(100%) not working (CSS) ... have dynamic heights based on some varying criteria, e.g. The height and width can be set to auto (this is default. width: calc(100%-3em);} is 100% of the immediate parent, not the window. vh means viewport height, so in order to make an element 100% of the browser window width you should use vw Now that weve computed everything on paper, we need to move all this stuff to the Calc() will be a valuable feature in CSS3 once it is supported. I have a div that I want to fill the whole height of the body less a set number in pixels. Sometimes you want to size an element based on that viewport, like a sidebar. calc() is particularly useful for calculating relative values, such as relative widths and heights. Computed middle cells width. One CSS selector has width : ... Can the value of a CSS property depend on value of ... Can the value of a CSS property depend on value of ANOTHER property? Thus, we can divide the total height of 100% by the number of DIV elements (5) to obtain our answer: #container { height: 500px; width: 600px; } .row { height: calc(100% / 5); font: bold 15px arial, sans-serif; border: thin solid black; padding-left: 10px; line-height: 2em; } Here is example 1 in CodePen.