Design comparison
Solution retrospective
Hello, I have a problem with the background of the site. What would you do if you wanted to design the background to look like this project? How do you place the pattern? Thank you for helping me
Community feedback
- @BlackysynchPosted over 1 year ago
Hi congrats on completing the challenge.
for the background I suggest using contain instead of cover this ensures that the background fits into the container element.
In your code
body { font-family: "Red Hat Display", sans-serif; font-size: 1.6rem; background-image: url(./images/pattern-background-mobile.svg); background-repeat: no-repeat; background-size: cover; background-color: var(--pale-blue); } /*Responsive*/ body { background-image: url(../images/pattern-background-desktop.svg); background-size: cover; background-position: top; }
replace by background-size by
body { background-image: url(../images/pattern-background-desktop.svg); background-size: contain; }
The background-position is not needed. contain takes care of the sizing according to container size.
I hope this can be helpful to you...
Marked as helpful1 - @KamaniaPosted over 1 year ago
I experienced the same issue. I temporarily resolved it by using Internal CSS. Insert the background image in the css internally
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