Design comparison
Solution retrospective
I am having some issues styling the background image to only take up the top part of the viewport.
What specific areas of your project would you like help with?Why when I click on the plus image it no longer gets the desired images from the correct source and instead displays the alt text?
Community feedback
- @LeviKuhauluaPosted 5 months ago
Howzit, for the background, you can make use of the following:
body { background: url(path/to/background-image/), [background-color]; background-size: 100%; background-repeat: no-repeat; }
This will ensure that the background starts with the background image then transition to the background-color.
For the images, it might be due to the
img
tags having the sameid
attribute. To have it so that the images change when you click on them, each img will need to have a uniqueid
, then you would need to add an event listener for eachimg
element and handle the logic for when users click on them.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