HTML Academy
Feathering + Stretch
Shadow Play7/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
Inner Shadow
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Shadow Color

The shadow color can be set using any CSS-supported color format. If the shadow color is not specified, then it is taken from the text color of the element with the shadow. This is why in the current assignment the original shadow color is yellow.

box-shadow:
[inset] — internal
5px     — x-offset
10px    — y-offset
[2px]   — feathering
[3px]   — stretch
[red];    <— color

The shadow color is a powerful tool in the hands of a skilled designer, who can use it to create expressive effects.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Shadow Color</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="light"> <button class="btn btn1" type="button">Button</button> </div> <div class="dark"> <button class="btn btn2" type="button">Button</button> </div> </body> </html>
CSS
.btn1 { box-shadow: 0 0 5px 4px; } .btn2 { box-shadow: 0 0 5px 4px; } html, body { margin: 0; padding: 0; font-size: 18px; font-family: "Tahoma", sans-serif; } .light { padding: 50px 0; background-color: #2c3e50; } .dark { padding: 50px 0; } .btn { display: block; margin: 50px auto; padding: 15px 20px; width: 150px; border: none; box-sizing: content-box; background-color: #3498db; color: yellow; 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
    1. For the first button, change the shadow color towhite.
    2. For the second button, change the shadow color to#2c3e50.

    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.