Reputation: 9165
I have trouble to understand why the use of percentages is not working in this case: Could somebody enlighten me?
#wrapper{
position:relative;
width:90%;
height:90%;
background-color: black;
}
HTML:
<body>
<div id="wrapper">
</div>
</body>
Upvotes: 0
Views: 467
Reputation: 5483
The width will take a percentage of the parent container. If you did not set a width on the body element, then the width is 0. To solve your problem:
body {width:100%;}
#wrapper {width:90%}
This results in a div 90% of total width of the screen.
Upvotes: 0
Reputation: 28437
Are you sure you also put this CSS code?
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
Upvotes: 2