答案 0 :(得分:1)
<div style="width: 150px; overflow-x: auto;position:relative ">
<ul style="position:fixed">
<li>Some data</li>
<li>some more data </li>
</ul>
<div style="height: 100px; width: 500px;margin-top:60px">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
</div>
</div>
答案 1 :(得分:0)
嗨Rana检查我在你的代码中玩了 white-space:nowrap; 的预言。 此空白属性将以水平方式继续我们的内联元素....
nowrap 是proptery white-space 的值,此nowwrap值会抑制元素中的所有换行符。
<div style="width: 250px; border:1px solid red; ">
<ul>
<li>Some data</li>
<li>some more data </li>
</ul>
<div style="border:1px solid black;width:150px;height:70px;overflow-y:hidden;overflow-x:scroll; white-space:nowrap;">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
<img src="http://www.fiveriverstech.com/wp-content/themes/fiverivers/images/about_s.jpg">
</div>
</div>