Take a look at my html and css:
html , body{
width: 100%;
height: 100%;
margin: 0 0 0 0;
}
.wrapper {
background: -webkit-linear-gradient(top, rgb(193, 112, 39) 0%, rgb(243, 141, 49) 20%, rgb(203, 119, 41) 99%);
background: -o-linear-gradient(top, rgb(193, 112, 39) 0%, rgb(243, 141, 49) 20%, rgb(203, 119, 41) 99%);
background: -ms-linear-gradient(top, rgb(193, 112, 39) 0%, rgb(243, 141, 49) 20%, rgb(203, 119, 41) 99%);
background: -moz-linear-gradient(top, rgb(193, 112, 39) 0%, rgb(243, 141, 49) 20%, rgb(203, 119, 41) 99%);
background: linear-gradient(to bottom, rgb(193, 112, 39) 0%, rgb(243, 141, 49) 20%, rgb(203, 119, 41) 99%);
width: 100%;
height: 100%;
position: absolute;
overflow: auto;
}
.content {
margin: 10px auto 20px auto;
width: 724px;
border: black 1px solid;
}
HTML:
<body>
<div class="wrapper">
<div class="content">
</div>
</div>
</body>
My wrapper div on default take window width and window height as its size. I want my content div always fill wrapper height and keep its margin, the problem is I can't set content div's height = 100% because it has margin, and will make wrapper div overflow. Here is my jsfiddle
Edit
Example to clarify the question:
Assume that div.wrapper
's height = 200px
div.content
's height will be 200 - (10 + 20) = 170px
I know I can do this by jquery but I want to find a solution with html/css
Note: div.wrapper
's height depend on user screen resolution.
SOLVE
Thanks for your guys attention! I really appreciate it. And I found the solution here by using css3 calc
function. I think this information will helpful to you.