CSS Questions

By P. Conrad, for CISC474, Spring 2007

  1. Give three examples of CSS "properties".
  2. What is a "selector"?
  3. For each of the following, write a single CSS rule
    1. Indicate that <h1> headlines should be just a "little bit larger" than normal text (instead of "much bigger" than normal text.)
    2. Indicate that <h1> and <h2> titles should be centered.
    3. Indicate that any list items in an nested ordered list should use a,b,c not 1,2,3 as the numbering.
  4. What do the letters CSS stand for? More importantly, provide a brief explanation of each of the three words, and what they mean in the context of CSS.
  5. Font sizes can be specified with percentages, a unit called the "em" and in pixels. Explain what each one means, and what the advantages and/or disadvantages are of each approach.
  6. Here are four ways that CSS can be applied to an HTML element (1) style attribute on an HTML element, (2) internal style sheet, (3) external style sheet (4) Manipulation of CSS properties through JavaScript.
    1. Give an example of the syntax for each.
    2. Give a use case for each of the four ways that CSS can be applied to an HTML element.
  7. How can you use CSS to insert a "page-break" into a document so that when it prints, the page break comes in a certain place (for example, just before a major "section" in the document—e.g. an <h2> heading?)
  8. What are the "general purpose" block and inline HTML elements that are used to apply CSS rules either to an entire section of a document, or a few words inside a paragraph?
  9. What is the "box model"? Briefly explain the "box model" concept, including the concepts of margin, border, padding and content.
  10. Briefly explain the difference between absolute positioning and relative positining in CSS, and the use of float and clear.