重複した属性をいつ、どのように分類する必要があるのだろうか。読みやすさ、コードのパフォーマンス、構造間の短所と利点を考慮してください。2 つの CSS コードがあるとします。
1番目のコード:
.a {
text-align: center;
font-size: 1em;
background-color: red;
}
.b {
text-align: center;
font-size: 1em;
background-color: green;
}
.c {
text-align: center;
font-size: 2em;
background-color: blue;
}
.d {
background-color: blue;
}
2番目のコード:
.a,
.b,
.c {
text-align: center;
}
.a,
.b {
font-size: 1em;
}
.c,
.d {
background-color: blue;
}
.a {
background-color: red;
}
.a {
background-color: green;
}
.c {
font-size: 2em;
}
それで、どちらがより良い人ですか、以前はどうもありがとうございました:)