Css3 Fundamentals - Study Mode

[#46] Which of the following selector is used to selects siblings?
Correct Answer

(B) E ~ F

Explanation

Solution: p ~ strong {font-style: italic
} /* sets the font style to italic on all strong tags that have a p tag as a preceding sibling */

[#47] Which of the following selector is used to selects the elements that are the default among a set of similar elements?
Correct Answer

(C) :default

Explanation

Solution: :default {background-color: red
} /* sets the background color of a default button like a submit to red */

[#48] Which of the following selector is used to selects the element that is the first child of its parent that is of its type?
Correct Answer

(D) :first-of-type

Explanation

Solution: strong:first-of-type {font-size: bigger
} /* sets the font size bigger on the first strong tag of its parent */

[#49] Which of the following selector is used to selects the element that is the nth child of its parent?
Correct Answer

(A) :nth-child(n)

Explanation

Solution: div:nth-child(2) {background-color: red
} /* sets the background color to red if the div is its parent’s second child */

[#50] Which of the following selector is used to selects the element that is the root of the document?
Correct Answer

(D) ::selection

Explanation

Solution: :root {background-color: blue
} /* sets the background color to blue for the root element */