我遇到了一個大麻煩成長......我不能讓一個div增長與內容... 我有了這個HTML在這裏解決它......但我不能這樣做.. 。 有人可以幫我弄這個嗎...??股利不與內容
我在這裏上傳的鏈接:http://efdutra.com/help
,我需要成長,以及..你會看到Lorem存有越過頁腳股利...:P
有某些部分在html:
<div id="boxes">
<div id="boxFinal">
<div id="linksBoxFinal">
<ul>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
<a href="#"><li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li></a>
</ul>
</div>
<img id="barraFinal" src="img/barraBoxFinal.png" />
</div>
</div>
這裏的CSS:
#boxes{
margin:0;
padding:0;
position:relative;
float:left;
height: 100%;
width: 100%;
overflow: none;
}
#boxFinal{
margin:15px 0 0 8px;
padding:0;
float:left;
position:relative;
width:100%;
max-height:100%;
overflow:inherit;
}
有人可以幫幫我嗎...?
你需要[清除](#stackoverflow.com/questions/639925/div-collapse-when-using-float)'#boxFinal'因爲它的身高已經因爲浮動後裔而摺疊 – Adrift 2013-04-23 14:33:35
是否可以將列表元素放置在錨內? – core1024 2013-04-23 14:37:32
@ core1024不,代碼是無效的。錨必須在裏面 – Adrian 2013-04-23 16:00:50