Sign in
Log inSign up

Do long CSS selectors make page rendering slow?

Sharon Chaisky's photo
Sharon Chaisky
·May 22, 2017

I've heard that having really long selectors in your CSS makes your page rendering slow.

Since I'm used to using SASS, so I always end up having really long selectors. Something like this:

.parent .child .element .child .child2 .child3 .child4 .child5{
    ...
}

Is it true that long selectors make rendering slow? and are there any ways to avoid this from happening?