Reputation: 235
I'm trying to visualize the structure for my future pages and containers in the full screen.
<div class="top">top</div>
<div class="middleleft">left</div>
<div class="center">center</div>
<div class="middleright">right</div>
<div class="bottom">bottom</div>
.top
{
background-color: yellow;
height: 20%;
}
.middleleft
{
float: left;
background-color: blue;
width: 20%;
}
.center
{
float: left;
background-color: white;
width: 60%;
margin: auto;
height: 60%;
}
.middleright
{
float:left;
background-color: red;
width: 20%;
}
.bottom
{
height: 20%;
background-color: green;
}
For some reason, even with height defined on the CSS, it does not fill the entire screen to the bottom, linking only enough background color height and width until the text ends.
What code change is needed to fill the screen to the dimensions it has (like the 60% width on the center div), without having to write characters to the bottom to fill out the div on the screen?
I do not wish to use JavaScript or JQuery in the solution, only CSS and HTML.
Many Thanks
Upvotes: 2
Views: 114
Reputation: 3317
This can be achieved, but I think you need to ask yourself why you want to do this. Today, with mobile there is no standard screen size, so a full screen for one screen is not going to be a full screen for another.
Instead, why not try adding some real content to your proposed structure and see how it stacks up then?
Or, if it's purely for mockup purposes, then maybe use some graphics software where it's much easier and quicker to move things around.
Upvotes: 0
Reputation: 423
Wrap the top/center/bottom content into one class allowing the left/right divs to merely sit outside of the wrapper.
Upvotes: 0
Reputation: 445
I added this:
html, body {height:100%;}
Then I set your center div to height 100% (and made it pink so it can be seen more easily).
EDIT: I left your side divs alone as I'm not sure what you want to do with those, but I hope this helps.
Upvotes: 2