나는 평소 테이블 대신 div를 사용하여 일부 html을 만들려고합니다.CSS 및 div 위치 지정
내가 원하는 것은 #company
div 아래에 표시되는 #hdrdetail
div - 녹색 div 아래에서 시작하는 주황색 div입니다. 어떻게 float을 사용해야하는지 잘 모르겠습니다.
희망 답변에 충분합니다.
#maindiv {
background-color: yellow;
height: 100 % ;
width: 700px;
margin: auto;
}
#logoleft {
width: 25 % ;
float: left;
height: 40px;
background-color: red;
}
#company {
width: 50 % ;
float: left;
height: 80px;
background-color: green;
}
#logoright {
width: 25 % ;
float: right;
height: 40px;
background-color: red;
}
#hdrdetail {
float: none;
width: 100 % ;
height: 80px;
background-color: orange;
}
#weekly_lefthdr {
float: left;
width: 50 % ;
height: 60px;
background-color: blue;
}
#weekly_righthdr {
float: right;
width: 50 % ;
height: 60px;
background-color: aliceblue;
}
<div id="maindiv">
<div>
<div id="logoleft"></div>
<div id="company"></div>
<div id="logoright"></div>
</div>
<div id="hdrdetail">
<div id="weekly_lefthdr">
</div>
<div id="weekly_righthdr">
</div>
</div>
</div>
작은 jsfiddle이 많이 도움이 될 것입니다. 그러나,'''clear : left;''를 hdrdetail에 추가하십시오. – amenadiel
고마워요. – Malcolm