Design comparison
SolutionDesign
Solution retrospective
Hello,
Someone can help me with my background. I don't understand how to make it responsive. When I resize my viewport the image disappear.
Thanks :)
Community feedback
- @VectorGitsPosted over 1 year ago
Where did you place your image, and how? Here's mine...
body { background-image: url("images/bg-pattern-top.svg"), url("images/bg-pattern-bottom.svg"); background-repeat: no-repeat; background-position: -50% 200%, 125% -175%; }
Yeah, I found out in this challenge that two images can be used as
background-image
in CSS :)I hope you find this helpful, and congrats on completing the challenge!
Marked as helpful0 - @SahorriPosted over 1 year ago
I rewrited my code and I use the solution with the pseudo selector ::before and ::after
body::before, body::after { position: absolute; content: ''; width: 100vw; / height: 100vh; background-size: auto; transform: translate(-50%, -50%); z-index: -1; } body::before { top: 0; left: 0; background: url("images/bg-pattern-top.svg") no-repeat bottom right; } body::after { top: 100%; left: 100%; background: url("images/bg-pattern-bottom.svg") no-repeat top left; }
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord