先預(yù)覽下效果吧
Vs
ok,上代碼~
HTML:
CSS:
.demo-tab{ position:fixed; bottom:41px; overflow:hidden;/*主要*/ width:100%; height:50px;/*主要*/ } .demo-tab ul{ width:100%; height:60px;/*主要*/ font-size:0; background:#e8e8e8; overflow-x:scroll;/*主要*/ overflow-y:hidden;/*主要*/ white-space:nowrap; } .item{ display:inline-block; width:33.3333333%; height:100%; padding:10px 0; font-size:18px; background:#9c9c9c; } .item-on{ height:12px; background:#04be02; }
總結(jié)一下,其實就是外層的div的高度要比里層ul/div或者其它元素的高度小,然后overflow:hidden
這是目前已知的一種,也許還會有其它方法吧,希望這個方法能對dev有幫助。
美圖,請欣賞,縮小尺寸了~
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com