HTML Academy
Multiple Borders for One Element
Shadow Play14/17
Back to the list of tasks
  • 1. The box-shadow Property
  • 2. Horizontal Shadow Offset
  • 3. Vertical Shadow Offset
  • 4. Shadow Feathering
  • 5. Stretching the Shadow
  • 6. Feathering + Stretch
  • 7. Shadow Color
  • 8. Inner Shadow
  • 9. Challenge: Dim Shadows
  • 10. Semi-Transparent Shadow
  • 11. Casting a Shadow Only from One Side
  • 12. Multiple Shadows
  • 13. Multiple Borders for One Element
  • 14. Shadow Art – 1
  • 15. Shadow Art - 2
  • 16. Shadow Art - 3
  • 17. Challenge: The Foreboding Shadows
Shadow Art - 2
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Shadow Art – 1

The most interesting application of shadows is in drawing. Craftsmen can create complex images using shadows. We will also create a fairly simply, but recognizable image in pure CSS.

The source code already contains a placeholder – a rounded element that is 100 by 100 pixels in size without borders and background. The shadows are the same size and shape as their parent element, so the shadows we add will be circular.

Before starting, here are a couple of notes:

  1. If you do not specify a shadow parameter, then it will be equal to 0 by default.
  2. You do not have to specify all of the options for the box-shadow property (prefixed and not). Use the one that works in your browser (server-side validation uses the unprefixed version).

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Shadow Art – 1</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="circle"></div> </body> </html>
CSS
body { padding: 20px; background-color: white; } .circle { margin: 10px auto; width: 100px; height: 100px; border-radius: 50%; }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0

    Add three inner shadows for .circle. For each new shadow, add it to the beginning of the list of shadows.

    1. Stretch of 10px, color: black, inner.
    2. Stretch of 9px, color: #6c6d70, inner.
    3. Both offsets of 5px, feathering of 5px, offset of 3px, color: white, inner.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.