HTML Academy
Casting a Shadow Only from One Side
Shadow Play12/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
Multiple Borders for One Element
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Multiple Shadows

The box-shadow property allows you to assign several shadows to one element. To do this, you need to list the values of the shadows separated by commas. For example:

box-shadow:
  0 0 5px 0 red,
  0 0 10px 0 white;

The shadows that are in the list above will overlap the shadows that are below.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Multiple Shadows</title> <link rel="stylesheet" href="style.css"> </head> <body> <button class="btn" type="button">Button</button> </body> </html>
CSS
body { background-color: black; font-size: 18px; font-family: "Tahoma", sans-serif; } .btn { display: block; margin: 100px auto; padding: 15px 20px; width: 150px; border: none; box-sizing: content-box; background-color: #34495e; color: white; text-align: center; text-transform: uppercase; font: inherit; }

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 two shadows to the button:

    1. Assign the first shadow a vertical offset of -5px, feathering of 10px, stretch of -3px, and the color: #3498db.
    2. Assign the second shadow a vertical offset of -5px, feathering of 10px, stretch of -3px, and color: #2ecc71.

    The horizontal offset for both shadows should be zero.

    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.