
Solution retrospective
Struggled with the background SVG, the cover fit would crop it at full size. Threw in the towel after multiple tries.
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@patrickppg
About your struggle with the SVG background, since those images are not an essential part of the content of the page, but just a visual background effect, you can implement them fully with CSS. It is easier as well!
Delete that
<div class="background-images">
and the associated styles and add this to your stylesheet:body { background-image: url("./images/pattern-background-desktop.svg"); background-size: 100%; background-repeat: no-repeat; background-color: var(--pale-blue); @media (max-width: 450px) { background-image: url("./images/pattern-background-mobile.svg"); } }
In CSS, backgrounds can also be images and consist of multiple layers of them, so you can add multiple images as the background and one color to be painted below the images. You can read about it in the MDN reference about the background property and its longhands.
Join 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