
As a follow-up to the I'm not going to teach you XHTML/HTML and homework review entries, today I'll introduce you to Cascading Style Sheets (CSS).
If you are working on a Case site, you will have noticed that each set of templates comes with its own set of style sheets that determine the color scheme, fonts, etc. In most cases you can just leave these alone, but there may be times when you want to do something special such as adding colored borders to a table, or creating a red (cranberry) alert headline to emphasize something important. To do that it helps to learn a bit of CSS.
While XHTML and HTML are used to form the structure of a Web document, CSS controls the presentation. Presentational elements that can be controlled by CSS include font, color, position, alignment (with some limitations), and other elements that affect how a page will look to the reader. As an example, the Wolves site on the top right does not use CSS, while the image of the same site on the lower right does use CSS.
The W3C recommendation for CSS Level 1 was released in 1996, the first version of level 2 was released in 1998, and level 3 is currently under development. As each level builds upon the others you do not need to specify which version you are using, however you do need to understand which browsers support which CSS elements as well as the different ways they may interpret them.
In addition to controlling how a page will look in a Web browser, CSS can also be used to determine how content will be presented on a printed page, on tv screens, in braille, and other media types. This is particularly useful to those who are developing content for multiple purposes. Rather than creating 10 versions of the same site, one can specify that different style sheets are used depending on how the page is read.
In addition to the flexibility of multiple formats, CSS—when implemented properly—can be a real time-saver. If you've just built a 50 page site in purple and gray, and your boss suddenly decides it should be cranberry and navy, all you have to do is change the style sheet. In a pre-CSS world you would have had to edit all 50 pages, but with CSS you only need to edit one. While there are many great reasons to use CSS, not limited to the fact that they conform to the web standards, the best way to understand it is to start using it.
If you completed our XHTML/HTML homework project, as I did with my http://jigsaw.w3.org/css-validator/ to make sure your style sheet is valid, then post your link in the comments field below.
You will be using the same tools for this project that you used to build your site. I find that it is usually helpfully to upload the files repeatedly as I go so that I can check how things are working. CSS is more difficult to learn that HTML, but you don't need to understand everything at once. If it doesn't make sense immediately, just be patient. Also do not worry about vertical alignment. This is not yet well-implemented, and is bound to cause frustration. Instead choose a design that is not dependent upon vertical alignment.

There are a variety of great books and sites that will teach you more about CSS. The ones I am most familiar with are by Case alumnus, Eric Meyer, who is the über-authority on CSS. Eric is also a past Webmaster of http://www.case.edu. Before working at Case, Eric and I both worked at the same law publishing company—proving once again that there are only 2 degrees of separation in Cleveland.
Those with links in the title can be read online by Case students, faculty and staff, and by others with Safari ProQuest subscriptions. For other visitors, I've included links to purchase the books from Amazon.com at the end of each description.
Next: Lesson 2
Comment by Case Stevens — May 2, 2007 @10:09 am
Comment by Internet Marketing Agentur Stuttgart — May 27, 2007 @9:21 am
Comment by Heidi Cool — May 27, 2007 @6:24 pm
Comment by Anonymous — July 5, 2007 @10:39 am
Comment by Rashid — July 16, 2008 @4:09 am
Comment by cheap web hosting — November 2, 2008 @4:04 pm
Pingback by » I’m not going to teach you CSS: Lesson 2 | Web Development Blog: Heidi Adams Cool — August 7, 2009 @1:18 pm