简体   繁体   English

css overflow-x:auto仅在宽度小于一定量时显示

[英]css overflow-x:auto to show only when width less than certain amount

my <html style="overflow-x:hidden; overflow-y:hidden 我的<html style="overflow-x:hidden; overflow-y:hidden

inside have a div with overflow-x:auto; 里面有一个带溢出的div-x:auto; overflow-y:scroll; 溢出-Y:滚动; min-width:960px; 最小宽度:960像素; but when my browser viewing mode is larger than 960px, it still showing the horizontal scroll bar. 但是当我的浏览器查看模式大于960px时,它仍然显示水平滚动条。 how to make the horizontal scoll bar only show if necessary when width less than 960? 如果宽度小于960,如何制作水平scoll bar?

All you have to do is 你所要做的就是

<html style="overflow-x:auto; overflow-y:auto>

but it is prettier when overflow-y is set to scroll ; 但是当overflow-y设置为scroll时它更漂亮;

Also

overflow-x:auto; overflow-y:scroll;

should be applied to html tag or to :root . 应该应用于html标签或:root Only in that case they will work. 只有在那种情况下他们才会工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM