Build a hero banner with a gradient overlay, rounded card corners, a soft shadow and an accessible focus outline for its button.
Quiz — 10 MCQs
- Which property rounds corners? (A) border-radius (B) outline-offset (C) box-size (D) text-align. Answer: A. Border radius controls corner rounding.
- Do outlines normally occupy layout space? (A) Yes (B) No (C) Only with Grid (D) Always. Answer: B. Outlines do not normally affect box dimensions.
- Which property creates a box shadow? (A) box-shadow (B) text-indent (C) background-position only (D) outline-style. Answer: A. Box shadow creates shadows around a box.
- What does background-size: cover do? (A) Fills the area, potentially cropping (B) Always shows the whole image without cropping (C) Hides the image (D) Changes font size. Answer: A. Cover preserves image proportions while filling the area.
- Which gradient creates a color transition along a line? (A) linear-gradient() (B) border-gradient-only (C) shadow-gradient() (D) font-gradient(). Answer: A. Linear gradients transition along a gradient line.
- Which gradient expands outward from a central point or shape? (A) radial-gradient() (B) conic-gradient() only (C) border() (D) outline(). Answer: A. Radial gradients spread outward.
- Which gradient rotates through an angular color sweep? (A) conic-gradient() (B) linear-gradient() (C) text-shadow() (D) opacity(). Answer: A. Conic gradients use angular transitions around a center.
- Can CSS backgrounds contain multiple image layers? (A) Yes (B) No (C) Only in SVG (D) Only in JavaScript. Answer: A. Multiple comma-separated layers are supported.
- Why should focus outlines not be removed without replacement? (A) Keyboard users need a visible focus indicator (B) It prevents CSS parsing (C) It changes IDs (D) It disables backgrounds. Answer: A. Focus visibility supports keyboard navigation.
- What is the purpose of background-position? (A) Positioning background images (B) Setting element IDs (C) Changing font weight (D) Setting border thickness. Answer: A. It controls the placement of background images.
Key Takeaways
- Use borders, outlines and shadows for different visual purposes.
- Backgrounds support images, gradients and multiple layers.
- Preserve visible focus indicators for accessibility.