[HTML] [CSS] No background image/color | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

[HTML] [CSS] No background image/color

Dear all, The background-color AND the background-image does not work :( I've tried different web browser, i've tried an URL image found online, i've tried my own images, i have tried to apply a color to the background, i've tried to put the path for the images...... but the background still appears white.... There is below my HTLM code with images only, and the CSS code below as well.... If someone could help please :( <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="coding_test.css" /> <title>JAJA</title> </head> <body> <header> <div id="conteneur1"> <div class="element"><img src="jarvis_images/file_selection2.png" alt=""/></div> <div class="element"><img src="jarvis_images/hive2.png" alt=""/></div> </div> </header> <article> <div id="conteneur2"> <div class="element"><img src="jarvis_images/file_selection_aside2.png" alt=""/></div> <div class="element"><img src="jarvis_images/coreREZISED.png" alt=""/></div> <div class="element"><img src="jarvis_images/hack_system2.png" alt=""/></div> </div> </article> <footer> <p><center><img src="jarvis_images/number_above2.png" alt=""/></center></p> </footer> </body> </html> ------------------------ # css body { background-image: url('fnd.png'); background-position: none; background-size: none; background-attachment: fixed; font-family: Georgia; font-size: 12px; } #conteneur1 { display: flex; justify-content: space-around; } #conteneur2 { display: flex; justify-content: space-around; }

5th Mar 2019, 9:49 AM
Jin 🌙
Jin 🌙 - avatar
4 Answers
+ 3
idk what's wrong. Maybe image path is incorrect? https://code.sololearn.com/Wjsi6i1Lo7U0/?ref=app
5th Mar 2019, 10:24 AM
Георгий Вавилов
Георгий Вавилов - avatar
+ 3
Omg guys I found out why... It is because I put a # CSS on the top of my .css file..... I got confused with Python, because i wanted to use a comment.... Sorry ah ah.
5th Mar 2019, 11:20 AM
Jin 🌙
Jin 🌙 - avatar
+ 1
Think it must be the image path. https://code.sololearn.com/W6Z0OovJ11mx/?ref=app I’ve added background-color: red; and that works fine.
5th Mar 2019, 10:47 AM
Russ
Russ - avatar
+ 1
The same code does not work on my computer (on my iPad with Solo Learn that’s fine)... :c I use Ubuntu, Chromium and Mozilla...
5th Mar 2019, 11:09 AM
Jin 🌙
Jin 🌙 - avatar