如果内容在其边框中溢出,如何在页面中制作一个自动水平滚动条。

<html>
     <body>
        <div style ="width: 20px; height:30px; border:1px solid black; overflow:auto">
            <!-- various of text here that can makes it go out the border-->
        </div>
     </body>
</html>

如果内容中的文本太长怎么办?如何制作自动水平滚动条?

最佳答案

将您的代码更改为此:

 <html>
 <body>
    <div style ="width: 20px; height:30px; border:1px solid black; overflow-x:scroll">
        <!-- various of text here that can makes it go out the border-->
    </div>
 </body>
 </html>

10-07 12:35
查看更多