This post was written for the students of the Columbia College Chicago class Blogging: Beyond the Basics in the Fall semester of 2014. It likely refers to specific software or settings that may quickly be out of date and may not apply to your situation, even in a future semester of the same class.
In class this week I talked about Survival CSS—knowing enough CSS to be able to troubleshoot an issue with a plugin or change a color of an element of your Theme.
CSS stands for Cascading Style Sheets. The “Style Sheet” part means just what it sounds like—it’s what gives a web page its style and appearance. The “Cascading” part means that you can have multiple style sheets applied to the same web page; styles get processed in order and later or more specific styles “win”. That’s what will let us tweak our CSS without actually editing the original CSS files—we can add our own CSS styles into a special style sheet that gets applied last of all to our blog, so it’ll always win.
A CSS style consists of a selector (what part of an HTML document the style will be applied to) and then pairs of properties and values assigned to that property.
For example, if we wanted to set the font and color of everything in a paragraph tag in our HTML, the CSS would look like:
- As names—140 colors have specific names in CSS, ranging from common colors like blue and red to things like mediumorchid.
- As RGB (Red, Green, Blue) values in hexadecimal notation. For example, blue is #0000FF, red is #FF0000, and mediumorchid is #BA55D3.
- If both the numbers in each pair of RGB values are the same, a shortcut is to simply type the repeated digits once. So blue is #00F, red is #F00, and mediumorchid cannot be written with this shortcut, because the BA and D3 pairs are each different.