[英]Styling scrollbar only for div, not for entire body
我正在我的個人投資組合網站上工作,但滾動條樣式存在問題。 當我為整個身體更改它時,它可以完美工作,但是當我只想為可滾動內容部分設置樣式(導航欄位於頂部)時,所有內容都會崩潰,甚至無法滾動內容。 我還希望滾動條軌道是透明的,但是它也不起作用。
/* Scrollbar */
.content::-webkit-scrollbar
{
width: 10px;
}
.content::-webkit-scrollbar-thumb
{
background-color: rgba(83, 83, 83, 0.8);
border-radius: 5px;
}
.content::-webkit-scrollbar-thumb:hover
{
background-color: rgba(83, 83, 83, 1);
}
您缺少內容高度。 只需添加內容高度,您將看到滾動條。
.content{
height:300px; //for example.
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.