A few people asked what CSS was and what it did. Here’s a quick and easy video explaining exactly what CSS (a Cascading Style Sheet) is and what it does.
Most every site these days runs a main style sheet but there are also many others running as well. Every plugin has it’s own style sheet. CSS can dictate colors, underlines, padding and margins and so much more.
The browser looks at all of them. If and when it finds there are competing items (i.e. multiple instructions for a specific item) the browser will use the last one as it’s rule. That’s the cascading part.
Here’s a sample test:
Imagine having a single page of rules. Near the top you have a rule that says, “Anytime a post uses an element with an ID of Bananas, put a dotted border around it“. (why you would do that, I don’t know)
In the middle of the page you might have a rule that says, “Anytime the ID of bananas is used, make the text Yellow and make the border a solid line.”
And then at the bottom you might have a rule that says, “ID of Bananas? Make the border color Red.”
The browser would look at all three and for our fictional ID of bananas we would end up with… Can you guess?
A section with Yellow text and a solid Red border. Did you get that too?
Posted in: WordPress