"); } else { $mime_type = "text/html"; header("Content-type: $mime_type; charset=utf-8"); } ?> CS-081 Assignment 8

CS-081 Assignment 8

Introduction

The following questions are based on the specificity section of the Assignment 7 web page.

Write out the answers to the following questions. I am providing the answer to the first question to get you started.

The Assignment

Part I

  1. What is the specificity of html, body?

    Answer: 2 separate selectors, each with a specificity of 001.

  2. What is the specificity of html > body?

  3. What is the specificity of .special?

  4. What is the specificity of p.special?

  5. What is the specificity of a:hover?

  6. What is the specificity of .off-site a:hover?

  7. What is the specificity of #footer?

  8. What is the specificity of #footer a?

  9. What is the specificity of #footer a:hover?

  10. What is the specificity of p:first-child?

  11. What is the specificity of div > p.interesting span:hover img[src$=jpg]?

Part II

For each of questions 1-10 above (not #11!) write an English sentence that tells what elements will be affected by a CSS rule with the given selector.

If you would like to know, the answer to Question 11 would be, “All img elements that have a src attribute value ending in “jpg” and which are descendents of a span that the mouse is hovering over, provided the span is a descendent of a p element that has the class “interesting”, provided the p is a child of a div.” (If that didn’t make your eyes glaze over, just keep re-reading it. They will.)

Submission

Email your answers to me at: by midnight of the due date.

The Subject line of your email message must be: “CS-081 Assignment 8.”

Don’t forget to put your name in your email message!