0

私はdivを作成しましたが、そのdivには2つの子がulあり、もう1つはdiv、その内部divとフォントの要素をスクロールしてを修正したいものulです。div内部の周りに他のものを追加することはできませんdiv

コード

<div style="width: 200px; overflow-x: auto; ">
<ul>
    <li>Some data</li>
    <li>some more data </li>
</ul>
<div style="height: 70px; width: 500px">
    <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>​

ライブデモ

4

2 に答える 2

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>

デモ

于 2012-06-29T06:44:57.967 に答える
0

こんにちはラナは私があなたのコード内で空白の助けを借りてプレイしたことを確認します:nowrap; 財産。この空白のプロパティは、インライン要素を水平方向に継続します。

nowrapはプロパティの空白の値であり、この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>

デモを見る:-http://jsbin.com/ovazol/edit#html,live

于 2012-06-29T07:23:08.823 に答える