css 隐藏滚动条


1.暴力的隐藏x轴和y轴的滚动条

xxx::-webkit-scrollbar { height: 0 !important;width:0px !important; }

 

 

2.

<div class='parent'>

  <div class='child>xxx</div>

</div>

 

.parent {
width: 400px;
height: 200px;
border: 1px solid #AAA;
overflow: hidden;
}

.child {
height: 100%;

/* 隐藏y轴滚动条 */
margin-right: -50px; /* Maximum width of scrollbar */
padding-right: 50px; /* Maximum width of scrollbar */
overflow-y: scroll;

/* 隐藏x轴滚动条 */
margin-bottom: -50px; /* Maximum width of scrollbar */
padding-bottom: 50px; /* Maximum width of scrollbar */
overflow-x: scroll;
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM