Reputation: 37
In the HEAD of the page I have
<style type="text/css">
html {
overflow: hidden
}
html, body, #centralDIvision {
margin-left: auto;
margin-right: auto;
width: 1100px;
height: 400px;
}
#centralDivision {
float: left;
}
#outer {
display: table;
position: absolute;
height: 100%;
width: 100%
}
</style>
But instead of having the height of the centralDivision div equal to 400px, I'd like it to be 75% of the browser's current screen size. Is there a way for me to do this?
Upvotes: 0
Views: 442
Reputation: 16263
just for diversity, another approach, using absolute positioning:
#parent {
position: relative;
height: 400px;
}
#child {
position: absolute;
top: 12.5%;
bottom: 12.5%;
left: 0;
right: 0;
}
and a working example on jsFiddle, of course.
Upvotes: 2
Reputation: 13853
#centralDIvision { height: 75%; }
will get you pretty close, if the #centralDIvision element is a direct descendent of the body. (When height is specified in %, it's based on the parent's height.)
Upvotes: 1
Reputation: 34909
Have you tried replacing this
height: 400px;
with this?
height: 75%;
Upvotes: 0