CSS 레이아웃 문제가 있습니다. 다음은 내가 말하는 코드입니다. Fiddle.CSS 레이아웃 문제
<div id="header">
의 높이는<div id="menubuttons">
이어야합니다. 빨간색으로 표시했습니다. 나는 항상 div의 높이를 명시하지 않으면 자식의 높이를 얻을 것이라고 생각했습니다.<div class="contentLine>
은margin-top: 20px;
으로 정의되었지만<div id="theme">
에 붙어 있습니다.- 오른쪽 열에는 항상 왼쪽 열보다 큰 여백이 있습니다. 둘 다 브라우저 창과 동일한 여백을 갖기를 원합니다.
CSS
body {
margin: 0 auto;
padding: 0;
font-family:'Share', cursive;
}
#header {
width: 100%;
vertical-align: middle;
}
#header_logo {
width:;
float: left;
margin: 11px 20px 20px 20px;
background-color:;
}
#menubuttons {
margin-right: 0;
margin-top: 0;
height: 2.5em;
line-height: 2.5em;
display: inline-block;
background-color: red;
}
#menubuttons ul {
list-style-type: none;
margin:0;
padding:0;
}
#menubuttons li {
float: left;
margin-right: 20px;
}
a {
font-family:'Share', cursive;
}
a:link {
text-decoration:none;
}
a:visited {
text-decoration:none;
}
a:hover {
text-decoration:underline;
}
a:active {
text-decoration:underline;
}
#theme {
width: 100%;
height: 400px;
background-color: green;
margin-top: 0;
float: left;
}
.contentLine {
margin: 0 auto;
margin-top: 20px;
width: 96%;
}
.contentLine .column {
float: left;
margin: 0;
width: 30%;
margin-right: 1%;
padding: 1%;
position: inherit;
/* shadow for seeing div boundaries */
box-shadow: 0 0 1px black inset;
}
.contentLine #last {
margin-right: 0;
}
빠른 답변 주셔서 감사합니다. 그러나'헤더'와'menubuttons' 스틸은 같은 높이가 아닙니다. – Retador
@Retador * Some Issues * ** **처럼 **? –
빨리 입력하려면 Enter를 누르십시오 ... 내 의견을 편집했습니다 ... – Retador