<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>Title</title> <style> *{ padding: 0; margin: 0; box-sizing: border-box; } html,body{ width: 100%; height: 100%; } .box{ height: 100%; width: 100%; background: #ddd; overflow: hidden; } .inner{ width: calc(100% + 30px); height: 100%; padding-right: 30px; overflow-x: hidden; overflow-y: auto; background: red; } .dd{ height: 300px; margin-bottom: 10px; background: gray; } </style> </head> <body> <div class="box"> <div class="inner"> <div class="dd"></div> <div class="dd"></div> <div class="dd"></div> <div class="dd"></div> </div> </div> </body> </html>
css隐藏滚动条
最新推荐文章于 2025-03-24 08:06:36 发布