我想根據內容寬度開發div水平滾動。但是,這並不完美,請幫助我。這工作,如果我設定的上行寬度具體PX但不自動div水平滾動不工作自動
這是我的CSS和HTML
.sri{
width:550px;
height:40px;
margin:auto;
padding:0px;
overflow-x:scroll;
overflow-y:hidden;
}
.sri ul{
margin:0px;
padding:0px;
list-style:none;
width:auto;
}
.sri ul li{
width:auto;
margin:0px 5px;
padding:0px 5px;
float:left;
height:auto;
background:#CCCCCC;
color:#333333;
}
<div class="sri">
<ul>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
<li>something content comes here</li>
</ul>
有些時候我只有一個李的內容在這種情況下我能做什麼 – sridhar 2011-02-16 13:15:05