Search code examples
csspixel

CSS width/height pixel and percentage calculation combintaion?


Is there a way to set the height/width CSS properties to something like that: 100% - 50px So if the total 100% is 1000px, then the end result would be 950px. And the 100% is set by the browser size.

UPDATE: What I'm trying to do is:

I have two div, the first div's height is 50px, I would like the second div's height to cover the remaining space.


Solution

  • After search though the net, I realized that it can't be done. The only way to simulate is to adjust it with JavaScript and onresize event.