HTML Academy
Shadow Spread
Shadow Play6/17
Back to the list of tasks
  • 1. The box-shadow Property
  • 2. Horizontal Shadow Offset
  • 3. Vertical Shadow Offset
  • 4. Shadow Blur
  • 5. Shadow Spread
  • 6. Blur + Spread
  • 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 Color
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Blur + Spread

Blur and spread are sometimes used together to make a shadow look lighter or darker. With the same shadow color, compare these combinations:

  1. If you apply blur with a negative spread radius, the shadow will look very light;
  2. If you use blur with zero spread, you get a shadow with soft edges;
  3. If the spread radius is positive but smaller than the blur radius, the shadow will look darker than with zero spread.
  4. If the blur radius is less than the spread radius, the shadow will look very dark.

Experiment for yourself.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Blur + Spread</title> <link rel="stylesheet" href="style.css"> </head> <body> <button class="btn btn1" type="button">Button 1</button> <button class="btn btn2" type="button">Button 2</button> <button class="btn btn3" type="button">Button 3</button> <button class="btn btn4" type="button">Button 4</button> </body> </html>
CSS
.btn1 { box-shadow: 0 0 0 0 #34495e; } .btn2 { box-shadow: 0 0 0 0 #34495e; } .btn3 { box-shadow: 0 0 0 0 #34495e; } .btn4 { box-shadow: 0 0 0 0 #34495e; } body { background-image: url("bg.jpg"); font-size: 18px; font-family: "Tahoma", sans-serif; } .btn { display: block; margin: 50px auto; padding: 15px 20px; width: 150px; border: none; box-sizing: content-box; background-color: #3498db; 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
    1. Give the first button a blur radius of 6px and a spread radius of -2px.
    2. Assign the second button a blur radius of 6px.
    3. Give the third button a blur radius of 6px and a spread radius of 3px.
    4. And finally give the fourth button a blur radius of 3px and a spread radius of 6px.

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

    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.