4 Replies - 712 Views - Last Post: 13 July 2012 - 08:06 AM

#1 WebNoob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 16-June 07

background image not showing

Posted 13 July 2012 - 12:33 AM

Hi all,
I am experiencing a problem that I can not explain. The background-image property does not seem to work when placed in the body element in an external CSS file. However, when placed inline in the body element of my pages, the background image appears. I tried to track down the cause of the problem by deleting everything except the body element in the external CSS file and keeping everything inside it the same. Then I deleted everything on my homepage until all I had was a page with nothing but bare bone HTML tags. To my surprise the background image still did not show up. My path in the background-image property is images/Back.jpg. My HTML files and the images folder (where I keep all my images) are on the same level. Can someone please tell me what the problem could be. Thanks in advance for your help.

Is This A Good Question/Topic? 0
  • +

Replies To: background image not showing

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 4139
  • View blog
  • Posts: 13,089
  • Joined: 08-June 10

Re: background image not showing

Posted 13 July 2012 - 12:57 AM

is the CSS file on the same level as the HTML file?
Was This Post Helpful? 0
  • +
  • -

#3 WebNoob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 16-June 07

Re: background image not showing

Posted 13 July 2012 - 01:02 AM

Hi, thanks for replying. The css file is in a folder called CSS and this folder is on the same level as the html files.
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 4139
  • View blog
  • Posts: 13,089
  • Joined: 08-June 10

Re: background image not showing

Posted 13 July 2012 - 01:04 AM

as I thought. the path of the image given in the CSS file is resolved relative to the CSS file’s location. hence if it works in the HTML file it cannot work in the CSS file. you would need to change the image path in the CSS file accordingly.
Was This Post Helpful? 0
  • +
  • -

#5 WebNoob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 16-June 07

Re: background image not showing

Posted 13 July 2012 - 08:06 AM

My problem is resolved, thank you for everything.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1