HTML:
<div id="parent">
<div id="child">
<ul>
<li>one</li>
<li>A very long name. A very long name. A very long name. A very long name. A very long name. A very long name. </li>
<li>Three</li>
</ul>
</div>
</div>
CSS:
#parent {width:170px; border:1px solid #000; padding:20px}
#child {border:1px solid #F00}
我没有将宽度属性应用于子 div。我想要的是在父 div 上看到水平和垂直滚动条。
小提琴:http: //jsfiddle.net/NanzR/
预期输出: