I have a problem for set responsive width and height to a container.
I need to set height and width of the container in 80% of my screen, but thats not work (i think because body have no height and width).
thats an exemple code :
<div id="container">
<div class="box">
<div class="element"></div>
<div class="element"></div>
<div class="element"></div>
<div class="element"></div>
</div>
<div class="box">
<div class="element"></div>
<div class="element"></div>
<div class="element"></div>
<div class="element"></div>
</div>
</div>
#container
{
width:100px;
height:100px;
background-color:blue;
padding:5px;
margin-left:auto;
margin-right:auto;
}
.box
{
width:100%;
height:50%;
background-color:red;
}
.element
{
width:22.5%;
height:96%;
margin:1%;
background-color:yellow;
float:left;
}
Thats the JSFIDDLE: https://jsfiddle.net/trsjc7cw/
Thanks a lot for your help !