如何防止此div的垂直滚动? [英] How to prevent the vertical scroll of this div?

查看:42
本文介绍了如何防止此div的垂直滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太喜欢CSS,并且存在以下问题.

I am not so into CSS and I have the following problem.

我有以下情况:在页面中,我有一个很大的表(由于未在页面中输入而被水平截断了).

I have the following situation: into a page I have a very large table (that was horizontally truncated because it not entered in the page).

因此,为了解决此问题,我将此表放入了一个可滚动的div中,如下所示:

So to solve this issue I put this table into a scrollable div, something like this:

<div style="overflow-x: scroll;">
    // Into this div there is my original table
</div>

所以我使用了 overflow-x:scroll; 属性,因为我希望div的内容只能水平滚动(而不是垂直).但是问题是我获得了以下输出:

So I have used the overflow-x: scroll; property because I want that the content of the div is only horizontally scrollable (not vertically). But the problem is that I obtain this output:

您可以看到div内容结果也可以垂直滚动,但我不想要它.我无法发布小提琴,因为内部表是由标签库呈现的.

As you can see the div content result scrollable also vertically and I don't want it. I can't post a fiddle because the inner table is rendered by a tag library.

如何解决此问题并仅获取水平滚动条?我想念什么?

How can I fix this issue and obtain only the horizzontal scroll? What am I missing?

Tnx

推荐答案

尝试

<div style="overflow-x: scroll; overflow-y:hidden;">
    // Into this div there is my original table
</div>

这篇关于如何防止此div的垂直滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆