CSS Syntax Quiz

7 Questions | Total Attempts: 1181

SettingsSettingsSettings
Please wait...
CSS Syntax Quiz

This is a test of CSS syntax meant as a review for advanced web design students to make sure they've not forgotten anything. Assume that the css you're looking at is in a separate. Css file that is linked correctly to an html page.


Questions and Answers
  • 1. 
    What does the following mean to the computer? div p {color: #ff0000;}
    • A. 

      Make text in all divs and all paragraphs in this document be bright red

    • B. 

      Make the background in all divs that are of the class "p" be bright red

    • C. 

      Make the text inside any divs inside of any paragraph be bright red

    • D. 

      Make the text inside any paragraph that is inside any div be bright red

  • 2. 
    Look at the following HTML: what is the MOST SIMPLE way that you could make the words "jay's favorite" and only those words red without making any of the other text in the page red as well?
    • A. 

      Span {color:#ff0000;}

    • B. 

      Li {color:#ff0000;}

    • C. 

      Li span {color:#ff0000;}

    • D. 

      Div ul li span {color:#ff0000;}

    • E. 

      Li, span {color:#ff0000;}

  • 3. 
    What does the following mean to the computer? div.leftnav a, div.bottomnav a {text-decoration:none;}
    • A. 

      Make the text inside any anchor tags that are inside either a div with the class "leftnav" or the class "bottomnav" have no text decoration

    • B. 

      Make an anchor tag that is inside a div with the class "bottomnav" which is inside a div with the class "leftnav" have no text decoration

    • C. 

      Make the text inside any anchor tags that are inside either a div with the ID "leftnav" or the ID "bottomnav" have no text decoration

    • D. 

      All of the above

  • 4. 
    Here we have 4 different blocks of code. Each one contains the text "hello". Which of the following would display without an underline if this rule were in the stylesheet for this page? .leftnav #mylink a {text-decoration:none;}
    • A. 

      A

    • B. 

      B

    • C. 

      C

    • D. 

      D

    • E. 

      Either a or c

  • 5. 
    DIVs should only use ID's and spans should only use Classes
    • A. 

      True

    • B. 

      False

  • 6. 
    What are the main differences between ID and Class
    • A. 

      Classes are for use with spans and ID's are for use with DIVs

    • B. 

      ID's are supposed to be only used once per page but Classes can be used multiple times per page, and one element can have more than one Class but should have only one ID

    • C. 

      Classes should be used only once per page, but ID's can be used as many times as you like on one page

    • D. 

      ID's are better than Classes

  • 7. 
    (this is not strictly about CSS, but what the heck) What is the main difference between a DIV and a SPAN ?
    • A. 

      Spans are, by default, inline and DIVs are by default Block

    • B. 

      DIVs are, by default, inline and SPANs are by default Block

    • C. 

      There is no real difference

    • D. 

      Spans can be inside DIVs but DIVs are not supposed to go inside spans

    • E. 

      Both a and d