우선,이 질문을 학습 목적으로하고 CSS를 더 잘 이해하고 있습니다. 둘째,이 정상화 버전을 사용하고 있습니다 :CSS 레이아웃 - 여백을 사용하지 않을 때 공백
https://necolas.github.io/normalize.css/
내 질문은 이것이다. 내 헤더 요소에 0으로 패딩을 설정하면, 내 레이아웃의 상단에 흰색 테두리를 얻을 : 내 헤더 패딩의 양을 설정할 때,
, 그것은 작업을 수행합니다
누구나 이것이 왜 있는지 말할 수 있습니다.
html,
body {
height: calc(100% - 100px);
}
body {
font-family: verdana;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.container {
position: relative;
height: 100%;
}
header {
width: 100%;
height: 125px;
padding: 0;
background-color: red;
}
nav {
width: 100%;
height: 50px;
padding-left: 10px;
vertical-align: middle;
line-height: 50px;
background-color: yellow;
}
aside {
float: left;
width: 200px;
height: calc(100% - 25px);
padding: 10px;
background-color: blue;
}
section {
float: right;
padding: 10px;
height: calc(100% - 25px);
width: calc(100% - 200px);
background-color: green;
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 50px;
padding-left: 10px;
vertical-align: middle;
line-height: 50px;
background-color: orange;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.1.1/normalize.min.css" rel="stylesheet"/>
<div class="container">
<header>
<h1>Header</h1>
</header>
<nav>Menu</nav>
<aside>Aside</aside>
<section>Content</section>
<footer>Footer</footer>
</div>
공백 때문에'h1'에서 여백이다. 웹 사이트가 다운되거나 문제가 더 이상 존재하지 않는다면 미래에 사람들에게이 질문이 쓸모 없기 때문에 여기에서 문제를 재현해야합니다. – APAD1
알다시피, 나는 jsfiddle 또는 다른 것을 사용하여 그렇게 할 방법을 생각할 것입니다. 고마워 btw! :) – Hardist
문제를 재현 할 수 있도록 표준화를 사용하지 않고 jsfiddle 링크를 추가했습니다. – Hardist