弹窗屏幕居中 自定义滚动条 css设置

弹窗屏幕居中:

半透明黑背景:
.black-wrap{
    position: absolute;
    width: 100%; 
    height: 100%;
    left: 0; 
    top: 0; 
    background: rgba(0, 0, 0, .5); 
    z-index: 999;
}

弹框内容:
.content{
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
}

自定义滚动条:

&::-webkit-scrollbar-thumb {
  background-color: rgba(136, 136, 136, .5);
  border-radius: 20px;
  z-index: 999;
}
&::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
&::-webkit-scrollbar-track {
  border-radius: 20px;
}

猜你喜欢

转载自blog.csdn.net/Embrace924/article/details/82761225