DIV水平滚动条是主要的水平滚动条

时间:2022-09-11 20:36:00

I have a layout with a container and then within that container is another div for the content. I have it set so that if a table is bigger than the container, there will be a scrollbar.

我有一个带容器的布局,然后在该容器内是内容的另一个div。我设置它,以便如果一个表大于容器,将有一个滚动条。

However, many of the tables are long, so in order to get to that horizontal scrollbar, you have to scroll all the way down to the bottom of the page scroll to the right then scroll back up to the top of the page to see the information.

但是,很多表都很长,所以为了到达那个水平滚动条,你必须一直向下滚动到页面底部滚动到右边然后向上滚动到页面顶部才能看到信息。

Is there a way to make it so the div's horizontal scroll bar is in the default/main horizontal scrollbar position?

是否有一种方法可以使div的水平滚动条处于默认/主水平滚动条位置?

body    {
    height: 100%;
    width: 100%;
    background: #e8d7b5;
    margin:0px;
    padding:0px 0px 0px 0px;
    font-family: Arial, Helvetica, Geneva, sans-serif;
    _text-align: center;
    overflow:hidden;
}
#bg {
    z-index: -999;
    min-height: 100%;
    min-width: 1024px;
    width: 100%;
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
}

div {
    border:none;
}
a   {
    color:#000000;
}
a:hover {
    color: #B89626;
}
li  {
    list-style-image: url(Bullet.gif);
}
#container {
    position: relative;
    width: 97%;
    min-height: 700px;
    overflow: auto;
    *height: 700px;
    margin: 0px auto;
    _text-align: left;
    padding: 0px 7px 7px 7px;
    background: #ffffff;
    }

#content {
    width: 99%;
    overflow-x: auto;

}
.navigation {
    background: #003b5b;
    border:3px;
    padding: 10px 10px 0px;
    border-color: #011d2d;
    width:100%;
    height: 30px;
    }
.standardtab {
    background: #011D2D;
    padding-left: 3px;
    padding-right: 3px;
    height: 25px;
}
.nonstandardtab {
    background: #0D4664;
    padding-left: 3px;
    padding-right: 3px;
    height: 25px;
}

There is my css. I have a container then a div for my content, which has the horizontal scrolling. I need the scrollbar of content to be the main scroll bar.

有我的CSS。我有一个容器,然后是我的内容div,它有水平滚动。我需要内容的滚动条作为主滚动条。

2 个解决方案

#1


0  

Set a height on the container and overflow:hidden; on the body to remove the default body scrollbars.

在容器上设置一个高度并溢出:隐藏;在body上删除默认的body滚动条。

#2


0  

Why don't you fix the height of table to height of page/container and include vertical scrollbar. So you can see the horizontal scrollbar on the screen, instead of scrolling till bottom of table and then reaching the h-scrollbar.

为什么不将表的高度固定到页面/容器的高度并包括垂直滚动条。因此,您可以在屏幕上看到水平滚动条,而不是滚动到表格底部,然后到达h滚动条。

Not exactly solution to your problem but may be an alternative.

不完全解决您的问题,但可能是一个替代方案。

#1


0  

Set a height on the container and overflow:hidden; on the body to remove the default body scrollbars.

在容器上设置一个高度并溢出:隐藏;在body上删除默认的body滚动条。

#2


0  

Why don't you fix the height of table to height of page/container and include vertical scrollbar. So you can see the horizontal scrollbar on the screen, instead of scrolling till bottom of table and then reaching the h-scrollbar.

为什么不将表的高度固定到页面/容器的高度并包括垂直滚动条。因此,您可以在屏幕上看到水平滚动条,而不是滚动到表格底部,然后到达h滚动条。

Not exactly solution to your problem but may be an alternative.

不完全解决您的问题,但可能是一个替代方案。