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.
Page 1 of 1
4 Replies - 336 Views - Last Post: 13 July 2012 - 08:06 AM
Replies To: background image not showing
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.
Page 1 of 1