Assignment 7 (pdf)

  1. What are the valid values for the CSS float property?

  1. Pete wants a 2 pixel dotted border around an element, colored black. What would the CSS property-value pair be that achieves that?

  1. We want to target all HTML list items that are somewhere inside an unnumbered list whose class is “awesome”. Which of the following selectors will achieve this? Only one is correct.

    1. "ul .awesome li"
    2. "ul.awesome li"
    3. "ul#awesome li"
    4. "ul, awesome li"
    5. "ul > .awesome li"
    6. "ul > .awesome > li"
    7. "ul > #awesome li"
    8. "ul > #awesome > li"
  2. We want to use jQuery to add at the beginning of each ‘li’ item in the document the html code: "<span>Awesome!</span>". Which of the following lines will achieve this? (You might want to create a mini-test page to test them). There is more than one correct answer, circle them all.

    1. $("#li").prepend("<span>Awesome!</span>")
    2. $("li").prepend("<span>Awesome!</span>")
    3. $("li").prependTo("<span>Awesome!</span>")
    4. $("<span>Awesome!</span>").before("li")
    5. $("<span>Awesome!</span>").prependTo("li")
    6. $("li").before("<span>Awesome!</span>")