Week 04

Tuesday

Today we're going to introduce CSS. CSS stands for "Cascading Style Sheets." These are style documents that "cascade," meaning that it has lines that if you define your text color as red at one point and blue at later point, you should expect that the style will cascade down to blue and that you'll never see the text appear as red. The cascading is much more complicated than that (different types of styling take priority in the cascade) but it is enough to know that not everything in the style sheet will be applied to the HTML document being viewed.

The point of separating style from content is that this reduces the amount of effort needed to make style changes to a large, complex Website. Instead of having to edit each HTML document individually (and there may be hundreds of such pages, such as I have with this Website), the developer can go into a single file - main.css (or some similar name) - and change a color setting, or rearrange elements, or modify the styling of the text, and trust that every page in the entire Website will change with it.

There are also times when it makes sense to create modular elements in HTML as well - such as your bannerhead, navigation bar, and footer, all of which tend to be the same on every page across the site but which need to be updated from time to time. Unfortunately, there is no way using pure HTML or CSS to do this (yet), so most developers rely on other languages like php (which we will not be learning in this class).

So we will now explore CSS declarations, which are comprised of HTML selectors, properties, and values (similar to the way that HTML elements are comprised of tags, attributes, and values). Instead of using left and right hats ‹›, CSS uses left and right curlies {}. For those of you who miss this class for whatever reason, spend some time reading an online introduction to CSS, such as the one at HTML Dog, which is a fairly gentle site for folks new to coding.