不常用的css--记录

63 阅读1分钟

伪类选择器的特殊用法:

  1. 当父盒子的子元素个数是动态的时候,想在有两个子元素时选中第一个子元素给他一个特定的样式。
.el-message-box__btns > .el-button:first-child:nth-last-child(2) {
    // 选中 el-message-box 弹窗中恰好只有两个按钮时的第一个按钮
    background-color: yellow !important;
}

mask

效果如下: image.png image.png image.png