i

Learn HTML and CSS in 10 Days

Use Desired Classes When Needed

There may be some time when CSS selector becomes so specific and long that it doesn't make sense further. There is a lag in performance, and it becomes quite strenuous to manage. When an element is applied with a class, more code may be created inside HTML, it offers the code to get processed faster and will get rid of any managing obstacles.

Suppose an element is nested inside element which is nested inside element which is again nested inside element, then the selector will look like aside h1 em. A more flexible selector to use at this place is the text-offset, to target element.

Bad Code

section aside h1 em { ... }

Good Code

.text-offset { ... }