intro-component-with-signup-form-master

Solution retrospective
Someone, please explain to me why the background images never show up when i publish a website, it shows up on my editor but not on the published site for some reason, same thing happened to this site as well.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @ilyesab
Hi @Nadine-Green, I think I know why your image doesn't show.
in the file SCSS/Components/_sections.scss is where you're styling the main container and where you set the background image:
main { background-image: url("../../images/bg-intro-desktop.png"); }
The path is correct since you're jumping one up to the SCSS and then one up to the root directory where the images folder exists. however the compiled index.css has the same code but it exists directly under the SCSS folder.
So the path should be:
main { background-image: url("../images/bg-intro-desktop.png"); }
Since Sass doesn't fix the path based on where the compiled file will be generated.
It shouldn't work on your local machine on mine it works and I'm using live server. I'm assuming since live server notices that we're going up above the root directory it fixes the path. because if I open the html file without live server the background doesn't show. so just fix that line and it should work.
Hope this was helpful.
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