CSS background image not shwoing | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

CSS background image not shwoing

So trying to display image but its not working, only a white background. The Heade.rjpg is in the same folder as the css file so idk what's wrong with it. The id is right anyway. Btw I'm using atom. #main_header{ font:900 20px; background: url(Header.jpg); } Heres the html and css file codes: <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>ggg</title> <link rel="stylesheet" href="C:\Users\john8\OneDrive\Desktop\Prog\CSS\Blog\Blog.css"> </head> <body> <header id="main_header"> <div class="container"> Sal_Toosh </div> </header> </body> </html> body{ font:Arial, sans-serif; } .container{ width:80%; margin:auto; } #main_header{ font:900 20px; background: url("Header.jpg"); height:500px; }

28th Jul 2020, 9:22 AM
Prog
Prog - avatar
3 Respuestas
+ 1
You missed " }" . Put it in last line.
28th Jul 2020, 9:31 AM
Allamprabhu Hiremath
+ 1
Get the url from online, it will work
28th Jul 2020, 11:07 AM
Ben Joseph
Ben Joseph - avatar
0
Oh I do have "}", just left it out when pasting. I'm using atom, not solo learn. I stored a file onto my laptop, not using a link to get the image.
28th Jul 2020, 10:17 AM
Prog
Prog - avatar