如何为一组 css 样式设置 :before psudo 属性,
.two-row-two-column mat-grid-tile:nth-of-type(3) .serveroutput-pop,
.two-row-two-column mat-grid-tile:nth-of-type(1) .serveroutput-pop,
.two-row-three-column mat-grid-tile:nth-of-type(2) .serveroutput-pop,
.one-row-two-column mat-grid-tile:nth-of-type(1) .serveroutput-pop {
left: -397px;
right: auto;
}
我期望的代码是这样的
(.two-row-two-column mat-grid-tile:nth-of-type(3) .serveroutput-pop,
.two-row-two-column mat-grid-tile:nth-of-type(1) .serveroutput-pop,
.two-row-three-column mat-grid-tile:nth-of-type(2) .serveroutput-pop,
.one-row-two-column mat-grid-tile:nth-of-type(1) .serveroutput-pop)::before {
left: -458px;
right: auto;
}
最佳答案
您可以像这样为每一行添加 before。所以它正常工作
.two-row-two-column mat-grid-tile:nth-of-type(3) .serveroutput-pop::before,
.two-row-two-column mat-grid-tile:nth-of-type(1) .serveroutput-pop::before,
.two-row-three-column mat-grid-tile:nth-of-type(2) .serveroutput-pop::before,
.one-row-two-column mat-grid-tile:nth-of-type(1) .serveroutput-pop::before {
left: -397px;
right: auto;
}
关于javascript - 如何设置:before psudo property for a group of css styles,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59663568/