Css html<;部门>;水平滚动条不会显示

Css html<;部门>;水平滚动条不会显示,css,html,scrollbar,Css,Html,Scrollbar,我看到外面也有类似的问题,但没有一个答案对我有帮助。因此,我试图有一个水平滚动条。但是,下面的代码环绕文本,而不是水平滚动。为什么会这样 <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 w

我看到外面也有类似的问题,但没有一个答案对我有帮助。因此,我试图有一个水平滚动条。但是,下面的代码环绕文本,而不是水平滚动。为什么会这样

<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>

如您所见,一旦此框中有足够的文本,该框将增长滚动条。。。这就是为什么我们称它为滚动框!您还可以将图像放入滚动框中。

将空白:nowrap添加到div标记的样式中