Answer the question
In order to leave comments, you need to log in
CSS optimization?
Where can I read about optimizing CSS selectors?
+ In particular, they are interested in:
1. Why is #ads_block a { ... } this selector bad?
2. Let's say I'm using the SASS preprocessor and I can use extend
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
.radius_10 {
@include border-radius(10px);
}
.box {
background: #000;
width: 100px;
height: 100px;
@extend .radius_10;
}
Answer the question
In order to leave comments, you need to log in
Read this article, written simply and clearly: frontender.info/writing-efficient-css-selectors
The answer to the first question in this paragraph
Why combine selectors? You yourself answered that there would be less code.
PS: do not use such
mixins, firstly there is an autoprefixer for this,
secondly border-radius has been working without prefixes
for a hundred years
PPS: You should only optimize css selectors if everything else is perfect
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question