流水

前端页面右侧出现两个滚动条的bug怎么办

今天熬夜赶(抄)一个前端的项目,遇到了一个bug,这不是frame、iframe,也没截图。

不仅有伤大雅而且我看着很难受,而且滚动有限制,往上滑到一个section的顶部的时候,滑轮再向上就滑不动了,应该是判断这是网页顶部了。

在我处理完之后,我搜了一下这个问题,也顺便回答了一下,贴一下他的图。

这个其实很容易解决,用三行css代码

body{overflow:hidden}
html{/*overflow-y:scroll;*/ }
html{overflow: auto; }

 

也看到了其他回答,比如

body::-webkit-scrollbar {
    display:none
}
这个也是可以实现的,就是直接隐藏侧边滚动栏,直接全都不显示。。

74 thoughts on “前端页面右侧出现两个滚动条的bug怎么办

  1. Have you ever considered about adding a little bit more than just your articles?
    I mean, what you say is important and everything. But imagine if you added some great images or videos to
    give your posts more, “pop”! Your content is excellent but with pics and video clips, this blog
    could undeniably be one of the best in its field.
    Superb blog!

  2. Hi there! Quick question that’s totally off topic. Do you know how to make your site mobile friendly?

    My web site looks weird when viewing from my iphone4. I’m trying to find a theme or plugin that might be able to
    resolve this problem. If you have any suggestions, please share.
    Appreciate it!

  3. Hello! This is my first comment here so I just wanted to give a quick shout out and say I
    really enjoy reading your posts. Can you suggest any other blogs/websites/forums that deal with the same subjects?
    Appreciate it!

  4. Simply desire to say your article is as amazing. The clarity in your put up is just spectacular
    and that i can assume you are a professional on this subject.
    Fine along with your permission allow me to take hold of your feed
    to stay up to date with coming near near post.
    Thank you a million and please continue the gratifying work.

  5. Hi there just wanted to give you a quick heads up.
    The words in your article seem to be running off the screen in Chrome.
    I’m not sure if this is a formatting issue or something to do with internet browser compatibility but I thought I’d post
    to let you know. The layout look great though! Hope you get the issue solved soon. Thanks

发表评论

电子邮件地址不会被公开。 必填项已用*标注

答案 : *
10 + 10 =


返回顶部