1
div.section{
/*border style code is skipped on this post*/
background-color: #99CCFF;
padding: 5px;
margin-top: 10px;
text-align: justify;
text-justify : auto;
overflow: hidden;
}
.topic{
/*border style code is skipped on this post*/
}
p{
overflow: hidden;
}
img{
float: right;
}
div#navi{
/*border style code is skipped on this post*/
margin: 5px;
width: 200px;
color: gray;
float: left;
}
div#navi h1{
text-align: left;
padding-left:10px;
}
div#navi ul{
margin-left: 0px;
}
<div id="body">
<div id="navi">
<h1>Links</h1>
<ul>
<li><a href="http://lab.com/">Lab.</a></li>
<li><a href="http://cse.univ.com/">CSE @ UNIV</a></li>
<li><a href="http://www.w3schools.com/">W3Schools</a></li>
<li><a href="http://www.csszengarden.com/"> Garden</a></li>
</ul>
</div>
<div class="section">
<h2><span class="topic">Cars</span>: 67 Shelby Mustang GT500 Convertible</h2>
<p>
<img src="67eleanorConv.jpg" alt="1967 shelby Mustang GT500 Convertible" title="1967 shelby Mustang GT500 Convertible" /> something..something..something..something..
</p>
</div>
<div class="section">
<h2><span class="topic">Sports</span>: Snowboarding</h2>
<p>
<img src="daaa.jpg" alt="Travis Rice Snowboard Jump" title="Travis Rice Snowboard Jump" /> something..something..something..something..something..
</p>
</div>
<div class="section">
<h2><span class="topic">Music</span>: Funk & Punk Rock</h2>
<p>
<img src="lesPaulBass.jpg" alt="Gibson Les Paul Bass" title="Gibson Les Paul Bass" /> something..something..something..something..
<br/>
<br/> something..something..something..something..
</p>
</div>
</div>
代碼的設置寬度是如此的長,所以我刪除的邊框樣式在CSS的部分。
我將div(id = nav)和div(id = section)換成div(id = body)
我使用「overflow =」隱藏「設置導航div左側的div大小。
但是我不能設置其他字段
第二列的佈局必須是液體佈局 - 也就是說,當瀏覽器尺寸發生變化時,它的所有部分都應相應調整尺寸
此處我張貼鏈接在東西我有,我想:
Result that I wanna make
也許,我已瞭解你的答案的邏輯,但它不工作。它不起作用的原因似乎是#navi的100%高度不會使高度達到100%。 – gunmuk
@gunmuk你能否用我的代碼顯示錯誤來複制問題。我會盡力解決! –
我不知道我是否理解正確。 – gunmuk