CIT597 Quiz 2
Fall, 2007
Name_________________________________________
  1. Write the CSS rule to make the background of an HTML page pale yellow (hex FFFFF0).
    body {background-color: #FFFFF0}

  2. The property:value pair color:blue will make selected elements blue. Write the CSS to make the following things blue:

    1. Everything
      * {color: blue}

    2. All headers (h1 through h6)
      h1, h2, h3, h4, h5, h6 {color: blue}

    3. Anything in bold (b)
      b {color: blue}

    4. Boldface (b) anywhere within a table
      table b {color: blue}

    5. Boldface (b) when it is the immediate child of a table datum (td)
      td > b {color: blue}

    6. An unordered list (ul) that immediately follows the largest header size (h1)
      h1 + ul {color: blue}

    7. A paragraph (p) whose font is specified
      p[font] {color: blue}

    8. A paragraph (p) whose font is specified to be Helvetica--or, if that font is not present, then Ariel
      p[font="Helvetica,Ariel"] {color: blue}

  3. Write the CSS to define a property named newword that can be placed within a paragraph (p) tag to make the enclosed element red.
    p.newword {color: red}     or     p#newword {color: red}

  4. Write the CSS to define a property named new that can be placed within any tag to make the enclosed element red.
    .new {color: red}     or     #new {color: red}

  5. HTML has tags named div and span.

    1. These tags have the same purpose. What is that purpose?
      To hold CSS information.


    2. What is the difference in the way these two tags are displayed? (Be sure to tell which is which.)
      span is inline; div forces a line break before and after.


  6. Label the three parts of a styled XML element:
    The element being styled
    padding
    border
    margin or margins

  7. A styled XML element can have one of three display properties. List them and briefly describe each.

    1. block -- on a line by itself

    2. inline -- doesn't put newlines before and after


    3. none -- the element is not displayed


  8. Briefly define "pseudo-element."

    Parts of the file that are not delineated by tags, but in some other way.