我努力理解divs。理解divs
我希望「導航」面板根據需要垂直展開。我的第二個問題是,我似乎無法使填充工作。我所做的任何更改都傾向於以'nav'div下面的'section'div爲結尾。
請參閱下面的jsfiddle和代碼。
在此先感謝。
https://jsfiddle.net/s59cwy9s/
<div id="container">
<div id="nav">
test
</div>
<div id="section">
test
<br><br><br><br>
test
<br><br><br><br>
test
</div>
</div>
#container
{
width: 1156px;
margin-top: 0;
margin-left: auto;
margin-right: auto;
box-shadow: 5px 5px 10px rgb(0,0,0);
position: relative;
background-color: transparent;
height: auto;
}
#header
{
background-color:black;
color:white;
text-align: center;
padding:5px;
}
#nav
{
line-height:30px;
background-color:#eeeeee;
min-height: 100px;
min-width: 80px;
float:left;
padding: 15px;
display: inline-block;
height: auto;
}
#section
{
/*float: none;*/
padding: 10px;
display: block;
/*position: absolute;*/
/*overflow: auto;*/
background-color: white;
width: auto;
height: auto;
}
不好意思啊,我不清楚。我希望他們在同一條線上。但是,由於某些原因,填充不起作用。 –
@Flamin_Squirrel會爲你更新嗎? –