Skip to content

Courses / CSS3 Mastery: Beginner to Advanced / Borders, Outlines, Shadows, Backgrounds and Gradients

2,092 people viewed this

Borders, Outlines, Shadows, Backgrounds and Gradients

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

  1. Which property rounds corners? (A) border-radius (B) outline-offset (C) box-size (D) text-align. Answer: A. Border radius controls corner rounding.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.

Rate this course

No ratings yet — yours can be the first.

Stars show on this course. Your written note stays private.

Your stars