HTML Academy
Creating a Complex Background – Part 3
Linear Gradients18/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
Buttons – Part 1
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Let’s Create a Complex Background – Final Step

In this step, we will finish creating the ornament. We have already stretched the container to fill the entire mini-browser window to make the ornament more visible. All that we have left to do is make small changes to the base fragment and multiply it.

Let’s return to the topic of multiple backgrounds. Not only are you able to define multiple background images, but you can also control the size, position, and repetition of each one individually. This entry:

background-size: 100px 200px;

will assign the same size to all background images. And this entry:

background-size:
  100px 200px,
  200px 300px,
  300px 400px;

will assign different sizes to all of the background images.

To set different property values for multiple backgrounds, you just need to list these values separated by commas in the same order in which you wrote the images.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>Creating a Complex Background – Final Step</title> <meta charset="utf-8"> <link rel="stylesheet" href="style.css"> </head> <body> <div class="pattern"></div> </body> </html>
CSS
.pattern { height: 100%; background-color: #333333; background-image: linear-gradient(135deg, white 25%, transparent 25%), linear-gradient(225deg, white 25%, transparent 25%), linear-gradient(45deg, white 25%, transparent 25%), linear-gradient(315deg, white 25%, transparent 25%); background-position: 0 0, 0 0, 0 0, 0 0; background-size: 100px 100px; background-repeat: no-repeat; } html, body { margin: 0; height: 100%; }

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. Reduce the the size of all background images to 50px in both width and height.
    2. Then for the first two backgrounds, set the location to 25px 0.
    3. Then set all background images to repeat horizontally.
    4. Finally, set them to repeat in all directions.

    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.