使主滚动条始终可见 [英] Making the main scrollbar always visible

查看:162
本文介绍了使主滚动条始终可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户访问网页时(当页面没有足够内容触发滚动条的激活时),需要什么CSS才能使浏览器的垂直滚动条保持可见?

What CSS is required to make the browser's vertical scrollbar remain visible when a user visits a web page (when the page hasn't enough content to trigger the scrollbar's activation)?

推荐答案

html {
    overflow: -moz-scrollbars-vertical; 
    overflow-y: scroll;
}

这使滚动条始终可见,只有在需要时才激活。

This make the scrollbar always visible and only active when needed.

更新:如果上面的不工作,只是使用这个可能。

Update: If the above does not work the just using this may.

html {
    overflow-y:scroll;
}

这篇关于使主滚动条始终可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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