简体   繁体   中英

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

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

inside have a div with overflow-x:auto; overflow-y:scroll; min-width:960px; but when my browser viewing mode is larger than 960px, it still showing the horizontal scroll bar. how to make the horizontal scoll bar only show if necessary when width less than 960?

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 ;

Also

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

should be applied to html tag or to :root . Only in that case they will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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