저는이 세 개의 사업부를 왼쪽으로 띄우기 위해 한 줄에 모두 표시하려고합니다. 그러나 float를 id = abkitchen에 남겨 둘 때마다 부동 상태가됩니다. 나는 그것이 페이지 상단에 고정 된 헤더를 가지고 있기 때문에 그것이라고 생각합니다. 그들이 어떻게 제대로 떠 다니는 지 어떻게 생각하세요? 미리 감사드립니다.사업부가 제대로 부유하지 않습니다.
HTML :
는<div id="headnav">
<ul>
<li><a href="theact.html" target="_self">The Act</a></li>
<li><a href="kitchenact.html" target="_self" class="active">Kitchen Act</a></li>
<li><a href="socialact.html" target="_self">Social Act</a></li>
</ul>
</div>
<div id="logo"><img src="images/logo.png"></div>
<div id="filters">
<div class="section" id="utensils">
<ul>
<li>HANDS<input type="checkbox" name="hands" value=".hands" id="hands"><label for="hands"></label></li>
<li>FORK<input type="checkbox" name="fork" value=".fork" id="fork"><label for="fork"></label></li>
</ul>
</div>
<div class="section" id="food">
<ul>
<li><input type="checkbox" name="burger" value=".burger" id="burger"><label for="burger">BURGER</label></li>
<li><input type="checkbox" name="cupcake" value=".cupcake" id="cupcake"><label for="fork">CUPCAKE</label></li>
</ul>
</div>
</div>
<div id="abkitchen"><p><em>Kitchen Act</em> is an exploration presenting a series of videos that investigate the interaction people have with everyday utensils. By pairing everyday food with an unexpected utensil, for instance, a burger with chopsticks, these interactions aim to foster an appreciation towards these tools that are often considered secondary to food. By establishing that utensils are the bridge between us and our food, these videos assert that utensils play a defining role in our experience of a meal.</p></div>
CSS : 모든
#headnav{
z-index:101;
position: absolute;
top: 0px;
height: 35px;
width: 100%;
background: #f9f9f9;
text-align: left;
font-size: 1em;
overflow: hidden;
padding: 0.35em 0.5%;
vertical-align: middle;
}
#headnav ul{
display:inline-block;
list-style-type:none;
margin:auto 0;
padding:8px;
}
#headnav li{
display:inline;
padding-right:10px;
margin-top:10px;
font-size: 14px;
}
#logo{
float:left;
padding:15px;
}
#abkitchen{
background-color: #E0E0E0;
padding:15px;
text-align: left;
width:50%;
}
#filters{
text-align: left;
padding:15px;
/*background-color: white;*/
}
#utensils, #food{
display: inline-block;
float:left;
width:auto;
height:auto;
background-color: yellow;
}
#utensils{
text-align: right;
padding-top: 15px;
padding-left: 15px;
padding-bottom: 15px;
}
#food{
padding-top: 15px;
padding-right: 15px;
padding-bottom: 15px;
margin-left: -5px;
}
li{
list-style-type: none;
}
주, 왼쪽,'유효하지 않습니다. 'float : left;'이어야합니다. – showdev
[나를위한 작품] (http://jsfiddle.net/ee6uR/). 방금'float : left'을'filters'와'abkitchen'에 추가했습니다. 그것은 다른 것일 수도 있습니다. – Kraz