CSS0025: div 可以滚动 但是隐藏滚动条 禁止选中文字,设置body可滚动不显示滚动条

1,

 <style>
            .cont {
                width: 200px;
                height: 200px;
                border: 1px solid #000000;
                overflow-x: hidden;
            }
            
            .cont::-webkit-scrollbar {
                display: none;
            }
        </style>

 

2,禁止选中文字,设置body可滚动不显示滚动条

        body {
            margin: 0px;
            padding: 0px;
            height: auto;
            inset: 0px;
            font-size: 1rem;
            line-height: 1.42857;
            overflow-x: hidden;
            background: inherit;
            tab-size: 4;
            
            -webkit-user-select:none;
            -moz-user-select:none;
            -ms-user-select:none;
            user-select:none;
        }

        body::-webkit-scrollbar {
            display: none;
        }

 

posted @ 2022-03-01 14:56  琥珀君  阅读(190)  评论(0编辑  收藏  举报