伪类选择器的特殊用法:
- 当父盒子的子元素个数是动态的时候,想在有两个子元素时选中第一个子元素给他一个特定的样式。
.el-message-box__btns > .el-button:first-child:nth-last-child(2) {
// 选中 el-message-box 弹窗中恰好只有两个按钮时的第一个按钮
background-color: yellow !important;
}
mask
- **描述:**遮罩层,遮罩元素的背景或其他图像内容,可为渐变,可为图片
- segmentfault.com/a/119000002…
- zhuanlan.zhihu.com/p/542619615
- zhuanlan.zhihu.com/p/540577278
效果如下: