Select all <p> elements with class quote, that are the direct children of <div> elements.
div > p.quote selects all children of <div> elements that are <p> elements and of the class quote. This is exactly what the question asks for. For more info, please refer to CSS Selectors and CSS Combinators.
From the following list of selectors choose all those that involve pseudo selectors.
Choose the best explanation of the difference between pseudo classes and pseudo elements.
State the advantages of using external stylesheets in CSS.
Which property controls the size of the text of an element?
font-size controls the size of the text of an element. Hence, the correct choice is (A).
Select the correct choice from the following to give all <p> elements the color blue and background color yellow.
Style declarations can't be separated using a , comma character - this rules out choice (A). Color names can't be quoted - this rules out choice (C). Finally, property names can't be followed by the = equals sign - this rules out choice (D). We are left with choice (B), which is the correct one.
Which of the following selectors has the highest level of precedence?
The more the number of selectors, the higher the level of precedence of the whole selector statement. Hence, the correct choice is (A). To learn more about precedence, please refer to CSS Style Precendence.
What is the specificity of the style attribute?
The style attribute has a specificity of 1000. To learn more about specificity in CSS, refer to CSS Style Precendence.
How else can we override a property's value written in the style attribute of an element, apart from writing it later in the attribute itself?
The !important keyword has the highest level of precedence in CSS, and can therefore override styles defined in the style attribute of an element.
Which delimiter represents a descendant combinator?
The space character denotes a descendant combinator. For more info, please refer to CSS Combinators.
What does the selector .deft + .capt select?
.deft + .capt selects all .capt elements that are the adjacent sibling of .deft elements. This goes with choice (C). For more info, please refer to CSS Combinators.
What does inherit do when assigned to a property?
When the value inherit is set on a property, the property's value is inherited by the ancestors of the given element.