내가 부모에CSS : 부모보다 더 하위 항목은
height: 100%
을 사용하고있는이 상황이 (100 %는 예상대로 작동하지 않음), 부모에 나는 34px 인이 헤더가 그리고 다시 100 % 인 컨테이너. 어떤 이유로 컨테이너 (정렬 된 목록)에 대한 부모
보다 큰 그리고 여기에 정렬 된 목록은 부모 section
요소 외부에 왜 CSS는
* {
height: 100%;
width: 100%;
margin: 0;
box-sizing: border-box;
}
section {
padding: 10px 20px 20px 10px;
border: 2px solid black;
}
header {
height: 30px;
background-color: blue;
}
ol {
list-style-type: none;
border: 1px dashed #d2d4d8;
box-sizing: border-box;
background-color: yellow;
padding: 0;
}
li {
display: inline-block;
box-sizing: border-box;
background-color: green;
width: 30%;
border: 1px solid blue;
font-size: 0;
}
어떤 제안입니까?
섹션의 패딩을 패딩으로 변경하십시오. 10px 20px 40px 10px; (10px + 귀하의 헤더 높이) 대답은 – Godinall