将div的水平滚动条固定到页面底部 [英] Fixing the horizontal scrollbar of a div to the bottom of a page

查看:1536
本文介绍了将div的水平滚动条固定到页面底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个比浏览器上呈现的页面长度长的表。该表位于类似于

I have a table which goes longer than the length of the page rendered on the browser. That table is placed within a Div which is like

<Div style="width: 100%; overflow: auto;">

因此,当页面的内容超过表的宽度时,使用浏览器滚动条向下滚动页面,查看上面div底部显示的水平滚动条。

As a result, when the contents of the page exceed the width of the table, I will have to scroll the page down using the browser scroll bar to look at the horizontal scroll bar that appears at the bottom of the above div.

我想永远修复水平滚动条的div在页面的底部。所以我可以滚动到表格的右边,即使不向下滚动。

I want to always fix the horizontal scroll bar of the div at the bottom of the page. So that I can scroll to the right of the table even without scrolling down.

这里是jsFiddle中的示例

Here is a sample in jsFiddle

我如何做?

推荐答案

是的,它显而易见。您已将 overflow:auto; 设置为 div 。每当内容超出其界限时,它将显示水平/垂直滚动条如果你真的想从 div 中删除​​该滚动条并将其设置为浏览器,只需删除那个css从那个div,并简单地添加到身体。

Yes, its obvious. You had set overflow: auto; to the div. It will surely display a horizontal/vertical scroll bar whenever its content goes beyond its bound. If you really want to remove that scroll bar from that div and set it to the browser, just remove that piece of css from that div and simply add it to the body.

这篇关于将div的水平滚动条固定到页面底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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