Answer the question
In order to leave comments, you need to log in
How to refer to a block within a block in css?
Hello!
What is the correct way to refer to blocks within blocks?
Here is the code in SASS
.block1 {
.block2 {
.block3 {
}
}
}
How to refer to block 3 in CSS? Or will it be enough just to write .block3 {} right away?
Answer the question
In order to leave comments, you need to log in
Well, if you write
.block3 {}
then all elements on the page with class block3 get the styles described in this block. If like this
.block1 .block2 .block 3 {}
then only the block3 elements that are inside the block2 block that is inside the block1 block will apply styles to themselves.
and to take and see the compiled css of your scss yourself is not destiny?
skrinshoter.ru/v/140519/ixSskVbO?a
https://codepen.io/anon/pen/arpvjQ
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question