Background Image isn't working!

+2 Linux Forever · November 2, 2015
hlp plz,I did  exactly what this person in the video said but when i save and reload,my webpage goes blank!

Post a Reply


- page 1
Oldest  Newest  Rating
0 Stephanie Coyle · November 5, 2015

did you put the background image tag in the body? Like for example:

body {
        background-image: url ("images/mylogo.png")
0 David Fee · November 6, 2015
It'd be helpful if we could see the code you have written. 
0 marija kamatovic · November 6, 2015
i have the same problem, actually it doesnt go blank but there is no way to apply image as the background...
0 Linux Forever · November 6, 2015
My code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       <style type="text/css">
                    background-image:url (k.png);

0 Jeff the Killer · November 6, 2015
maybe it is not in the same directory or file format is wrong or maybe the name is wrong
0 Stephanie Coyle · November 6, 2015
Linux Forever, the background will not display unless the actual image is put into a folder like for example. If you made a folder called images you would have to use body {background-image: url ("images/k.png") the image that you are trying to display must always be put into a folder otherwise the browser doesn't understand what you want it to do.

I hope my information has helped you.
0 Willie Jonez · November 6, 2015
Bro,Check if you are missing any punctuation, When ever I get this kind of problem, my only way of solving it is trying to start my code afresh, and make sure that the image extension is ".png" not ".jpg", because if you are using a ".jpg" image and you just included the ".png" its not gonna work.

Hope my answer aint late tho:)
0 Georgi Georgiev · November 7, 2015
1. Check if your image is in the same folder like your html file.
2. There must be a semicolon after:
background-repeat: no-repeat;
+1 Rafae Raees · November 9, 2015
Buddy you wrote the wrong code.

<style type = "text/css" >
background: url(images.JPG);

You forgot the colon after background.
0 Linux Forever · November 12, 2015
@Rafae Raees

Thank you!!!It worked my code was completely wrong.
  • 1
  • 2

HTML / CSS / Web Design


Discuss, share, ask, learn and teach HTML5 and CSS3.