CSS debabbled
Some of the trickier internet technologies are really just combinations of a bunch of other technologies used together to do something spiffy. In an effort to debabble Dynamic HTML in a couple of weeks, I'm going to cover some of the pieces that were necessary for it to come into being. I've already talked about one of the building blocks, Javascript. This week covers another important component: CSS.What is CSS?
One of the difficulties web developers experienced in the early days of the internet was the hassle of updating websites consisting of hundreds of pages. Change a logo, font, or even a simple color scheme, and you've got hundreds or potentially thousands of updates to make. Of course, dynamically generated pages (created on-the-fly from databases) made the task easier, but what if you could separate out the content itself from the formatting "rules"?
CSS was created to do exactly that. It stands for Cascading Style Sheets, but the last part is really the important one. A "style sheet" basically contains the rules for how a page should be formatted, such as font sizes, colors, etc. Some rules are universal (applied to just about any relevant element) and some are specific to particular items (such as a header or bulleted list). By separating out styles, changes can quickly and easily be made to entire websites. Conversely, stripping out the many tags required to format a page makes updating content and changing individual pages easier as well.
Pardon an aside, but I actually have no idea what about CSS is "cascading". Webopedia says that it refers to the capacity to apply multiple style sheets to the same page, but that doesn't feel like a cascade to me. Maybe, it's because the styles cascade across multiple pages, no matter how they're organized. If anyone from the W3C can enlighten me, I welcome your email.
What's in it for me?
I cheated a bit this week, and already covered some of the uses of CSS. Essentially, CSS makes developing large sites, especially if design and content are handled by different people or teams, quite a bit easier. Separating out formatting styles makes sitewide updates simple, as they're contained in just one or a couple of locations. CSS itself takes a little bit of learning, but there are many good and easy to find resources on the web, and if you're comfortable with HTML, you can pick up the basics in a few hours.


