Part Three: Asserting Your Importance

Important Floof

Before we talk about customizing elements of the layout, we should simplify our workflow a little bit. Remember in Part Two when we had to add multiple selectors to get our point across? Turns out this happened because of the CSS trait of precedence. If you have two bosses of equal rank, one telling you to keep things the way they were and the other to change everything, you’ll probably take the path of least resistance, unless you have a good reason not to.

You can be an upstart, though. You can lead the CSS to revolution. You can be important, no matter who you are, like this little floofy puppy:

importantfloof
You don’t have to be strong to be !important

In the last example, we had to say “.post.type-post” to change the background color on posts, but with “!important” we can use just one of those class selectors like so:

.post {
background-color: #701A6D !important;
}

This is a hot tip, and a shorter article than others, but there is some danger of using this trick too much. However, f you’ve tried a few selectors and few of them together and none of them are cooperating, put an !important in there and let them know you mean it, in a friendly way of course.


LL

(thanks Ryan and Dezro!)

By @nohoperadio - Leah Lindsaychen

Facilitator and Proprietor of Tales of Insecurity, a podcast of post-modern existential horror. I like to make the best of a bad situation, and also to make better ones. I'm here to be helpful!

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: