下のスニペットでは、私は灰色の背景を常に100%にしようとします。しかし、ウィンドウを小さくすると、.b
の背景が白くなることがわかります。ウィンドウを小さくしてスクロールする必要がある場合でも、背景を常に灰色にするにはどうすればよいですか?背景の高さは、スクロール後も常に100%です
ありがとうございました。
html,
body {
height: 100%;
padding:0;
margin:0;
}
.a {
height: 100%
}
.b {
height: 100%;
background: grey;
float: left;
}
.c {
height: 100%;
float: right
}
<html>
<body>
<div class="a">
<div class="b">Left
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
A lot of content <br/>
</div>
<div class="c"> Right</div>
</div>
</body>
</html>