div p, which elements will be styled?The descendant selector div p matches all p elements inside a div, regardless of nesting depth. It does not limit to direct children.
span elements inside section elements?The selector section span selects all span elements that are descendants of section elements. The other options use different combinators or group selectors.
p be?p be?<div><section><p>Hello</p></section></div>div p { color: blue; }
section p { color: red; }Both selectors match the p element and have the same specificity (two type selectors), but section p appears later in the CSS, so it wins in the cascade.
nav a to style links inside a navigation, what should you consider for accessibility?Using descendant selectors to style links affects their appearance. To keep content accessible, ensure color contrast is sufficient for users with visual impairments.
body div ul li a. Why can this descendant selector be less efficient for browsers to apply?Browsers match selectors from right to left. Deep descendant selectors require checking multiple ancestor levels for each matched element, which can slow down rendering in large documents.