Salve, ho questa struttura html
codice:
<body>
<div id='container'>
<header>
...
</header>
<section id='box'>
...
</section>
<footer>
...
</footer>
</div>
</body>
e questo file CSS
codice:
body,html
{
position: fixed;
margin: 0;
padding: 0;
top:0;
left:0;
width:100%;
height:100%;
border:0;
}
#container
{
position: relative;
margin:0;
padding:0;
top:0;
left:0;
width:100%;
height:100%;
background: yellow;
background-position: 0 0;
background-size:100% 100%;
float:left;
z-index: 1;
}
header
{
position: relative;
margin: 0;
padding: 0;
top:0;
width: 100%;
height:25%;
background: blue;
z-index: 2;
float:left;
border:none;
}
#box
{
position: relative;
margin:0;
padding: 0;
width: 80%;
height:60%;
background: red;
z-index: 2;
float:left;
border:none;
}
footer
{
position: relative;
margin: 1% 0 0 0;
padding: 0;
width: 100%;
height:15%;
background: green;
z-index: 2;
float:left;
border:none;
opacity:0.7;
}
Perchè se metto il body come POSITION:ABSOLUTE ho la scrollbar (quindi il contenuto eccede nelle sue dimensioni) mentre se lo metto POSITION:FIXED lo vedo correttamente??