浏览器滚动条样式
.scrollbar::-webkit-scrollbar{
height: 8px;
background-color: #f5f5f5;
}
.scrollbar::-webkit-scrollbar-track{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
border-radius: 10px;
background-color: #f5f5f5;
}
.scrollbar::-webkit-scrollbar-thumb{
height: 8px;
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #b6b6b6;
}
给对应的dom添加类名 scrollbar 即可
多行溢出打点样式
.line-3{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
word-break: break-all;
}
点击穿透
pointer-events: none;
vue全局颜色
this.color = 接口返回或定义一个值
document.body.style.setProperty('--color', this.color);
color: var(--color);
setProperty
纯css实现移动端适配
html {
margin: 0 auto;
min-width:375px;
max-width: 750px;
font-size: 13.3333vw;
}
@media screen and ( max-width: 375px ) {
html {
font-size: 50px;
}
}
@media screen and ( min-width: 750px ) {
html {
font-size: 100px;
}
}
设计图以750px为基准
设计图30px 对应代码就为 .3rem