簡體   English   中英

如何從 html 底部刪除溢出滾動邊框

[英]How can i remove overflow scroller border from bottom in html

我有一個帶有溢出滾動(.table-responsive)的引導表。 它工作正常,但我想從底部刪除滾動條。 我怎樣才能刪除它?

 <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <div class="table-responsive"> <table class="table table-bordered" style="width:1500px;"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td> </tr> <tr> <td>Mary</td> <td>Moe</td> <td>mary@example.com</td> </tr> <tr> <td>July</td> <td>Dooley</td> <td>july@example.com</td> </tr> </tbody> </table> </div> </div> <script> </script> </body> </html>

是不是因為你的桌子比它的容器寬。 要么使用 1500px 刪除內聯樣式,要么提供overflow-x: hidden; 到將禁用水平滾動的容器,但您的表格的寬度將相同,並且其中很大一部分將不可見

如果你想保持水平滾動,但想隱藏滾動條,那么你應該試試這個:

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

注意:它僅適用於基於 webkit 的瀏覽器

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM