HTML Academy
Repeating Linear Gradient
Linear Gradients15/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
Creating a Complex Background – Part 2
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Creating a Complex Background – Part 1

In this series of assignments, we will build a complex pattern using gradients. We will do this using the multiple background image technique.

In CSS, you can set several background images for an element at once by listing them separated by commas:

background-image:
  url('img1.png'),
  url('img2.png'),
  url('img3.png');

Likewise, you can use gradients instead of images:

background-image:
  linear-gradient(...),
  linear-gradient(...),
  linear-gradient(...);

We’ll be using gradients with transparent colors and sharp transitions. First, we will build a repeating fragment, and then we will multiply it. In this task, you will add the first two gradients, which should produce the following:

Example of the completed assignment

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>Creating a Complex Background – Part 1</title> <meta charset="utf-8"> <link rel="stylesheet" href="style.css"> </head> <body> <div class="pattern"></div> </body> </html>
CSS
.pattern { margin: 100px auto; width: 100px; height: 100px; background-color: #333333; background-image: none, none; box-shadow: 1px 1px 3px #333333; } html, body { margin: 0; padding: 0; }

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 gradients that transition from white totransparent with a sharp transition at 25% to the .pattern block:

    1. The first gradient should be at an angle of 135°,
    2. and the second gradient should be at an angle of 225°.

    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.