$container-max-width: 60rem; .container { max-width: $container-max-width; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
The max-width property limits the container's maximum width to 60rem. When the viewport is smaller, the container shrinks to fit the viewport width minus padding. The margin-left: auto and margin-right: auto center the container horizontally.
Option A uses correct CSS property names and includes semicolons. Option A uses background shorthand which is valid but the question asks for background color specifically. Option A misses a semicolon after background-color. Option A misses a semicolon after padding.
.container children of .wrapper?<div class="wrapper"> <div class="container">Direct child</div> <div> <div class="container">Nested container</div> </div> </div>
The > combinator selects only direct children. Option D correctly targets only .container elements that are immediate children of .wrapper. Option D selects all descendants, including nested ones. Options C and D select siblings, which is not the case here.
justify-content controls horizontal alignment in Flexbox.Option C uses Flexbox with justify-content: center to center the container horizontally. Option C centers vertically with align-items. Option C uses block display and margin auto which works but is not Flexbox. Option C aligns items to the start, not center.
Option B uses :focus-within to apply a visible outline when any element inside the container is focused, improving keyboard navigation visibility. Option B only styles the container itself when focused, which is rare. Option B triggers on hover, not focus, and Option B triggers on active (mouse click), not keyboard focus.