div 的水平滚动条

发布于 2024-08-16 06:14:55 字数 88 浏览 3 评论 0原文

海,

我有一个固定高度和宽度的div,假设我有宽度:400px;高度:200px;对于一个div。

如何为这个div带来水平滚动条

Hai,

I have a div with fixed height and width, lets say i have width:400px; and height:200px; for a div.

How to bring the horizontal scroll bar for this div

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

吾家有女初长成 2024-08-23 06:14:55

通过赋予它

overflow: auto

CSS 属性并用比 DIV 本身更宽但不更高的内容填充它。

By giving it the

overflow: auto

CSS property and filling it with content that is wider, but not taller, than the DIV itself.

梨涡少年 2024-08-23 06:14:55

输入

div {
overflow-x:auto; /* Horizontal scroll  */ 
overflow-y:auto; /* Vertical scroll   */
}

或使用

div {
overflow:auto; /* For Both */
}

type

div {
overflow-x:auto; /* Horizontal scroll  */ 
overflow-y:auto; /* Vertical scroll   */
}

or use

div {
overflow:auto; /* For Both */
}
水染的天色ゝ 2024-08-23 06:14:55

使用此CSS

  <div class="DataGridXScroll">

  </div>

.DataGridXScroll
{
    width: 1000px;     
    height: 300px; 
    overflow-x: scroll;
    overflow-y: scroll;
}

Use This CSS

  <div class="DataGridXScroll">

  </div>

.DataGridXScroll
{
    width: 1000px;     
    height: 300px; 
    overflow-x: scroll;
    overflow-y: scroll;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文