以下は私のCSSです&ここに私のfiddleというヘッダーがあります。ヘッダーには50pxの高さを使用していますが、ヘッダーに高さを追加する必要はありませんレイアウトは、すべてのページに収まらなければならないヘッダーに高さを追加することなくレイアウトを修正することができます
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
height: 100%;
}
#page {
height: 100%;
}
#header {
height: 50px;
background: yellow;
}
#content {
height: calc(100% - 100px);
background: grey;
overflow: auto;
}
#footer {
height: 50px;
background: blue;
}
<div id="page">
<div id="header">Header</div>
<div id="content">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It
has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It
has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
<div id="footer">Footer</div>
</div>
使用のパディング/マージン – madalinivascu
それはあなたの高さを追加していけない場合でも、どこにでもフィットしますが、あなたの最終目標は何ですか? – brk
私は全体のヘッダーに合うはずのバナーのイメージを持っているのでパディングを追加できません –