Design comparison
Solution retrospective
Had some difficulties with getting the background images properly aligned. I tried two approaches, once using background-image and another using images and absolute positioning. Neither one seemed to give the result of the images being a set distance from the center of the screen. Any tips? Would be greatly appreciated!
EDIT: Turns out some of the problem was related to the CSS reset I was using that set 'max-width: 100%'
Community feedback
- @Yashvir821Posted about 2 years ago
Hello Jo Blaszak, congratulations on your solution!
I know that's tricky to resize and move the background image here and there if you're not familiar with the property that does this change, I knew it only because I saw it on w3schools.com. But there is 1 way to do that:
- The best and easier way is using the code given below:
body {
background: url(mountain.jpg);
background-repeat: no-repeat;
background-size: 300px 100px;
background-position: 500px 200px; }
And if you are not familiar with multiple background images then you can write the code given below:
body{
background-image: url(img_flwr.gif), url(paper.gif);
background-repeat: no-repeat, no-repeat;
background-size: 300px 100px, 200px 300px;
background-position: 500px 200px, 100px 250px; }
I hope its helpful :)
1@jblaszakPosted about 2 years ago@Yashvir821 Hi, thanks for the response. I had updated the code already to fix the issue, I just forgot to edit the solution page to reflect the new changes. Turns out some of my issues were related to my CSS reset of 'max-width: 100%' for the images. Check out the solution, it's neatly centered now on all screen sizes!
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