Javascript 有没有办法简化这个css?

Javascript 有没有办法简化这个css?,javascript,jquery,css,jquery-ui,Javascript,Jquery,Css,Jquery Ui,有没有办法简化以下内容?如果是,我怎么做 .ui-layout-north { border-top: none; border-left: none; border-right: none; padding: 0px; } .ui-layout-west { border-top: none; border-left: none; border-bottom: none; padding: 0px; } #inner {

有没有办法简化以下内容?如果是,我怎么做

.ui-layout-north {
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 0px;
}
.ui-layout-west {
    border-top: none;
    border-left: none;
    border-bottom: none;
    padding: 0px;
}
#inner {
    border-top: none;
    border-right: none;
    border-bottom: none;
    padding: 0px;
}
#inner-center {
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 0px;
}
#inner-south {
    border-right: none;
    border-left: none;
    border-bottom: none;
    padding: 0px;
}

您可以在此处看到它的作用:

您可以用逗号分隔每个标识符,以便将相同的样式应用于多个元素:

#inner, #inner-center, #inner-south ... {
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 0px;
}
然后只需为具有不同样式的每个元素指定:

#inner { 
    border-left : inherit;
}

可以用逗号分隔每个标识符,以便将相同的样式应用于多个元素:

#inner, #inner-center, #inner-south ... {
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 0px;
}
然后只需为具有不同样式的每个元素指定:

#inner { 
    border-left : inherit;
}

分解然后指定。仅使用类:

.ui-layout-center, .ui-layout-south, .ui-layout-north, .ui-layout-west {
    border-style: none;
    padding: 0px;
}

.ui-layout-north {
    border-bottom-style:solid;
}

.ui-layout-west {
    border-right-style: solid;
}

.ui-layout-center {
    border-bottom-style: solid;
}

.ui-layout-south {
    border-top-style: solid;
}

分解然后指定。仅使用类:

.ui-layout-center, .ui-layout-south, .ui-layout-north, .ui-layout-west {
    border-style: none;
    padding: 0px;
}

.ui-layout-north {
    border-bottom-style:solid;
}

.ui-layout-west {
    border-right-style: solid;
}

.ui-layout-center {
    border-bottom-style: solid;
}

.ui-layout-south {
    border-top-style: solid;
}

每个块都有一组不同的说明符。对不起。我应该先戴上我的阅读眼镜。我现在看到其他人已经给出了可行的答案。每个块都有一组不同的说明符。对不起。我应该先戴上我的阅读眼镜。我现在看到其他人已经给出了可行的答案。另外,作为一项建议,使用类,即使对于#内部和#内部中心,它们也允许重用,并且ID比类具体255倍,使得在其他地方覆盖这些规则更加困难。使用.inner类,如果您需要在该元素上具有ID,请这样做,但不要将其用于设置规则的样式。此外,建议使用类,即使对于#inner和#inner center,它们也允许重用,并且ID比类具体255倍,使得在其他地方覆盖这些规则更加困难。使用.inner类,如果您需要在该元素上具有ID,请这样做,但不要将其用于样式规则。