如果我們布局的是后是fixed并且想要高度為100%的時(shí)候,我們一般會(huì)這樣設(shè)置:
width: 100%; height: auto; z-index: 9999999; padding-bottom: 1rem; position: fixed; top: 0; overflow-y: scroll; overflow-x: hidden;
但是這樣并不會(huì)出現(xiàn)滾動(dòng)條,正確的做法應(yīng)該設(shè)置top和bottom為0:
width: 100%; height: auto; z-index: 99999999; padding-bottom: 1rem; position: fixed; top: 0; bottom: 0; overflow-y: scroll; overflow-x: hidden;
————————————————
以上就是css解決fixed布局不會(huì)出現(xiàn)滾動(dòng)條的問題的解決方法。
新聞熱點(diǎn)
疑難解答
圖片精選