HTML and CSS Reference
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 addi-
tional selectors. They are discussed in Lesson 13.
1. Why can't absolute units be used reliably in CSS?
2. True or false: Including style sheets on your page requires features provided by a
3. How do the absolute and relative positioning schemes differ?
4. Is the margin or padding of an element inside the border?
5. How do you lay out your page so that elements positioned statically appear above
elements that are positioned absolutely?
1. Absolute units have problems in CSS because there's no way to know exactly what
sort of display medium the user has. An inch on one monitor might be completely
different than an inch on another.
2. The answer is false; you can use the <link> tag to load external style sheets with-
out involving the web server in any way.
3. The relative positioning scheme places elements relative to the previous element on
the page, whereas the absolute positioning scheme places the element exactly
where you tell it to on the page.
4. The padding of an element is inside the border of an element, and the margin is