Ask coding questions

← Back to all posts
Why the image is not showing in my website?
jerbycoding

guys im beginner and i am making my website but i have a problem
please help im crying.
HTML

<!DOCTYPE html><head> <title>This is test website</title> <link rel= "stylesheet" href="style.css"> </head> <body> <div class="banner"> </div> </body>

CSS
*{
width: 0;
height: 0;
font-family: 'Courier New', Courier, monospace;
}
.banner{
width:100%;
height:100vh;
background-image: url(pexels-tomasz-filipek-1637438.jpg);
background-size: cover;
background-position: center;
}

Voters
jerbycoding
Comments
hotnewtop
SixBeeps

When you call url() in your CSS you need to surround the URL with quotation marks. You also need an existing URL. The one you have right now is invalid, and would only work if you uploaded the image to the Repl. For now, this should work.

jerbycoding

@SixBeeps THANK YOU SO MUCH !!

Thank you so much, I thought my VS code has a bug so i reinstall it. thank you