Is there any advantage or disadvantage in using :not() over an inverted selector logic? May it be in performance, safety or browser support, which approach is recommended?
Either:
.imageSlider img:not(:first-child) {
display: none;
}
Or:
.imageSlider img {
display: none;
}
.imageSlider img:first-child {
display: block;
}
Sometimes it's could be better to use
:not.In this case, if you want to hide
everythingexcept div.an-other-thingit will be quicker to write :Instead of:
In most of cases, a longer CSS means longer time to execute it