ので、私は再例えば、何度も何度も親の名前を記述する必要はありません親に応じてグループにCSSを記述するためにそこの方法です:CSSのスタイルを親に合わせてグループ化する方法はありますか?
.firstparent {
.firstchild { background: red }
.secondchild { background: orange }
.thirdchild .grandchild { background: green }
/* This will only affect the elements with the class name that is the child of firstparent *??
}
.secondparent {
div { background: blue }
.firstchild { background: black }
}
/* Right now I am writing as below */
.firstparent .firstchild { background: red }
.firstparent .secondchild { background: orange }
.firstparent .thirdchild .grandchild { background: green }
.secondparent div { background: blue }
.secondparent .firstchild { background: black }
よりもむしろ再親の名前を書いておきます私は上記のようにCSSを書く方法が何度も何度もありますか?
組織にとっては、SASSやLESSのようなプリプロセッサを使用してください。彼らはあなたが望むものとまったく同じです。 – brezanac
@holodocありがとう、これは私が探しているものです! – Charas