Test questions
1) Generally, which takes precedence?
— CHOOSE YOUR ANSWER —
a local style
an internal style sheet
an external style sheet
HTML formatting
all of the above
none of the above
2) A style sheet contains this rule:
p > span { color: red }
Which of the following best describes this selector?
— CHOOSE YOUR ANSWER —
any p element that is a child of a span element
any p element that is a parent of a span element
any span element that is a child of a p element
any span element that is a parent of a p element
all of the above
none of the above
3) A style sheet contains this rule:
div strong { color: red }
Which of the following best describes this selector?
— CHOOSE YOUR ANSWER —
any strong element that is a child of a div element
any strong element that is a parent of a div element
any strong element that immediately follows a div element
any strong element that is a descendant of a div element
all of the above
none of the above
4) A style sheet contains this rule:
#navbar p, li { color: red }
Which of the following best describes this selector?
— CHOOSE YOUR ANSWER —
any p element, any li element, and any element with an id attribute that equals navbar
any p element that is a descendant of any element with an id attribute that equals navbar, and any li element
any li element that is a descendant of any element with an id attribute that equals navbar, and any p element
any li element that is a descendant of any p element that is a descendant of any element with an id attribute that equals navbar
all of the above
none of the above
5) A style sheet contains this rule:
div#navbar { color: red }
Which of the following best describes this selector?
— CHOOSE YOUR ANSWER —
any div element with an id attribute that equals navbar
any element with an id attribute that equals navbar that is a descendant of a div element
any div element with a class attribute that contains the word navbar
any div element with a class attribute that contains the word navbar that is a descendant of a div element
all of the above
none of the above
6) A style sheet contains this rule:
.menu { color: red }
Which of the following best describes this selector?
— CHOOSE YOUR ANSWER —
any element that is a descendant of any element with a class attribute that contains the word menu
any element that is a descendant of any element with an id attribute that equals menu
any element with a class attribute that contains the word menu
any element with an id attribute that equals menu
all of the above
none of the above
7) What is the difference between a class and an id?
— CHOOSE YOUR ANSWER —
an id must be unique in a page, while a class does not have to be unique in a page
an id must be unique in a site, while a class does not have to be unique in a site
an id can only be applied to a div element, but a class can be applied to other elements
there is no difference between a class and an id
all of the above
none of the above
8) A style sheet contains this rule:
#sidebar, p { color: red }
Which of the following describes this selector?
— CHOOSE YOUR ANSWER —
any p element with a class attribute that contains the word sidebar that is a descedant of a div element
any element with an id attribute that equals sidebar that is a descendant of a p element
any p element with a class attribute that contains the word sidebar
any p element with an id attribute that equals sidebar
all of the above
none of the above
9) A style sheet contains this rule:
div.sidebar div { color: red }
Which of the following describes this selector?
— CHOOSE YOUR ANSWER —
any element with a class attribute that contains the word sidebar that is a descendant of a div element
any element with an id attribute that equals sidebar that is a descendant of a div element
any div element with a class attribute that contains the word sidebar that follows a div element
any div element with an id attribute that equals sidebar that is a descendant of a div element
all of the above
none of the above
10) A style sheet contains this rule:
div + h1 { color: red }
Which of the following describes this selector?
— CHOOSE YOUR ANSWER —
any h1 element that is a child of a div element
any div element that is a parent of a h1 element
any div element that immediately follows an h1 element
any h1 element that immediately follows a div element
all of the above
none of the above
Do not click the Submit button unless you have answered all questions, and you are sure of your answers!
You will not have a chance to go back once you submit this form.