アップロードした画像で述べたように、希望の結果を得たいと思います。固定フッターの下端の高さを自動調整する方法
私は常に領域Aと領域Cの間のマージンを20pxとしたいと考えています。画面サイズが変更された場合、領域Cは領域Aと領域Cの間の余白を常に20pxに保ちながら、ギャップを埋めるべきです(図2参照)。現在、画面サイズが変わるたびに領域Aと領域Cの間のギャップが増減しますそれは地域によって満たされるべきむしろ私はしたくないC.
index.htmlを
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<title>Learn</title>
<link href = "styles.css" rel = "stylesheet">
</head>
<body>
<div style="text-align:center;">
<div class="boxA">
<h2>A</h2>
<div class="boxD"><h2>D</h2></div>
<div class="boxD"><h2>D</h2></div>
</div>
<div class="boxB">
<h2>B</h2>
</div>
<div class="boxC">
<h2>C</h2>
</div>
</div>
</body>
</html>
Styles.cssを
html, body {
margin:0;
padding:0;
width:100%;
height:100%;
}
body, h2{
margin: 0;
}
.boxA{
width: 500px;
height: 580px;
background-color: #006400;
margin-top: 20px;
margin-right: 20px;
display: inline-block;
margin-bottom: 0px;
}
.boxB{
width: 300px;
height: 350px;
background-color: blue;
display: inline-block;
}
.boxC{
width: 100%;
background-color: yellow;
margin-top: 20px;
position:absolute;
bottom: 0px;
}
.boxD{
width:220px;
display: inline-block;
background-color: red;
margin-left:20px;
float:left;
}
注:私はCSSでこれを実現したいです。 Javascriptはありません。
私は絶対にこの質問がupvotesを得た理由を理解することができません。私にとっては、それは典型的な*私のための仕事のための私のような - 怠惰な - (再)検索*質問のように見えます。ほとんどの場合、質問者以外の誰も回答から恩恵を受けることはありません。アップヴォートのラベルが明確に述べているように、「*この質問は研究努力を示しています;それは有用かつ明確です」*ありがとうございました。 –