Be Classless: Optimizing Your CSS for WordPress

It’s easy to get caught up adding HTML classes (and IDs) to each and every element we want to style, but the fact is, WordPress helps us out with specific targeting by adding its own classes and IDs to certain elements on every page and post. Cleverly utilizing WordPress’s default page build along with CSS’s pseudo classes and combinators makes it possible to be highly specific with our targeted styles while leaving the original HTML completely alone. In short, if we look for ways, we can often avoid adding more classes and wrapping text in spans to have WordPress and CSS do the work for us.

Speaker