Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何组合具有相同属性的两个类?_Css - Fatal编程技术网

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;
    }