HTML Academy
Buttons – Part 2
Linear Gradients21/23
Back to the list of tasks
  • 1. Hello, linear-gradient!
  • 2. Gradient Direction
  • 3. Diagonal Gradients
  • 4. Gradients at an Angle
  • 5. Diagonals vs. Degrees
  • 6. Challenge: Application Icons
  • 7. Uniform Multicolor Gradient
  • 8. Color Proportions and Color Stops
  • 9. Sharp Color Transitions
  • 10. Pseudo-Columns on Gradients
  • 11. Challenge: Flags
  • 12. Color Transitions in px
  • 13. Semi-Transparent Gradients
  • 14. Repeating Linear Gradient
  • 15. Creating a Complex Background – Part 1
  • 16. Creating a Complex Background – Part 2
  • 17. Creating a Complex Background – Part 3
  • 18. Let’s Create a Complex Background – Final Step
  • 19. Buttons – Part 1
  • 20. Buttons – Part 2
  • 21. Buttons – Part 3
  • 22. Challenge: Ornament Made of Shurikens
  • 23. Challenge: Satellites
Challenge: Ornament Made of Shurikens
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Buttons – Part 3

Now let’s create a more complex pseudo 3D button that really shines and sparkles.

To do this, we need a few more colors, manually set color stops, and one sharp transition.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>Buttons – Part 3</title> <meta charset="utf-8"> <link rel="stylesheet" href="style.css"> </head> <body> <button class="button simple-gray">Come</button><br> <button class="button strong-brown">See</button><br> <button class="button glossy-blue">Conquer</button> </body> </html>
CSS
.simple-gray { background-image: linear-gradient(#ffffff, #dddddd); color: #333333; } .strong-brown { background-image: linear-gradient(#cc0630 0%, #8f0222 75%, #6d0019 100%); color: #ffffff; } .glossy-blue { background-image: none; color: #ffffff; } .button { display: inline-block; margin: 20px; padding: 20px 50px; border-radius: 5px; border: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 1px 3px #aaaaaa; text-align: center; text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.4); font-size: 24px; font-family: "Lucida Grande", "Arial", sans-serif; line-height: 25px; } html, body { margin: 0; padding: 0; padding-top: 50px; text-align: center; }

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 .glossy-blue button, specify a “top to bottom” gradient with the colors #b8e1fc,#90bcea,#90bff0,#6ba8e5,#bdf3fd and the color stops 0%,35%,50%,51%,100%.

    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.