html 水平滚动条不会显示[英]html horizontal scroll bar would not show 本文翻译自  jazzblue  查看原文  2015-09-01  204    scrollbar/

时间:2021-02-16 20:34:59

I saw there are similar questions out there, but no answer that helped me. So I am trying to have a with a horizontal scroll bar. However, the following code wraps the text around instead of horizontal scrolling. Why is this happening?

我看到有类似的问题,但没有答案帮助我。所以我想尝试一个水平滚动条。但是,以下代码包装文本而不是水平滚动。为什么会这样?

<div style="height:120px;width:120px;overflow-x:scroll;overflow-y:scroll;">
As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.
</div>

1 个解决方案

#1


2  

Add white-space: nowrap to the style of the div tag.

添加white-space:nowrap到div标签的样式。

#1


2  

Add white-space: nowrap to the style of the div tag.

添加white-space:nowrap到div标签的样式。