ptg16476052
Workshop 195
8
You’ll continue to be introduced to new CSS properties in the lessons that follow. In
Lesson 9, I explain how to use CSS to create pages that respond to the devices view-
ing them, in Lesson 10 I show you how to change colors on the page and provide all the
details on using CSS to define the backgrounds of pages and specific elements. Lesson
16 takes a deeper look at CSS selectors and explains how to create entire page layouts
using CSS.
Workshop
In this lesson, you learned about Cascading Style Sheets, the wonderful supplement to
HTML that makes formatting your pages less painful. Throughout the rest of this book, I
use CSS where appropriate, so please review this workshop material before continuing.
Q&A
Q My CSS isn’t working like I’d expect. What should I do?
A CSS probably doesn’t seem that clear in the first place, and things can only get
messier when you actually start applying styles to your pages. You should be sure
to test your pages in every browser you can find, and don’t be afraid to experiment.
Just because something seems like it should work doesn’t mean it will. The W3C
also pr ovides a CSS Validator (http://jigsaw.w3.org/css-validator/) that you can use
to make sure that your CSS syntax is correct. You should probably use it all the
time, but even if you don’t, it can still help out if you get stuck.
Q Are there naming rules for classes and IDs?
A Yes, there are. A name must start with a letter and can contain only letters, num-
bers, or dashes (-). Some browsers may not enforce these rules, but to be safe, you
should adhere to them.
Q What are the relevant CSS standards?
A There are three CSS recommendations from the W3C: CSS1, CSS2, and CSS3.
Most modern browsers support a large part of CSS1 and CSS2, as well as parts of
CSS3. You can find out more at http://www.w3.org/Style/CSS/. If you’re curious
about how well your browser supports CSS or the effect that properties have in real
browsers, you can check out the CSS test suites at http://www.w3.org/Style/CSS/
Test/. CSS2 and CSS3 include a number of additional selectors.