Css 如何组合具有相同属性的两个类?
例如,如果我有:Css 如何组合具有相同属性的两个类?,css,Css,例如,如果我有: .logIn { border: none; outline: none; height: 100%; background-color: #151719; color: white; margin: 0 20px; float: right; padding-top: 16px; cursor: pointer; } .signUp { border: none; outline: non
.logIn {
border: none;
outline: none;
height: 100%;
background-color: #151719;
color: white;
margin: 0 20px;
float: right;
padding-top: 16px;
cursor: pointer;
}
.signUp {
border: none;
outline: none;
height: 100%;
background-color: #151719;
color: white;
margin: 0 20px;
float: right;
padding-top: 16px;
cursor: pointer;
}
我重复了两次相同的代码,组合它们的正确语法是什么?用逗号分隔类就可以了
.logIn, .signUp {
border: none;
outline: none;
height: 100%;
background-color: #151719;
color: white;
margin: 0 20px;
float: right;
padding-top: 16px;
cursor: pointer;
}