EthelPatterson
10-16-2009, 11:20 PM
Would there be any reason that a background image isn't showing? I've tried it on very basic html, div-layers and css. I've even tried different browsers and saving the image under different names and different formats. Can anybody think of any other reason an image wouldn't show?
Below is the background part of the css I'm using - anything really obviously wrong that I'm missing?
body
{ background: #ffffff;
background-image: top.gif;
background-repeat: no-repeat;
}
Any help would be really appreciated, thankyou!
iGeek
10-17-2009, 09:17 AM
You've run into the same problem as Freddcow (http://www.lissaexplains.com/forum/showthread.php?t=64156): you need to use url() so the browser knows CSS is requesting an image/URL:
body
{
background: #ffffff;
background-image: url(top.gif);
background-repeat: no-repeat;
}
I find shorthand CSS to be much more streamlined:
body
{
background: #ffffff url(top.gif) no-repeat;
}
EthelPatterson
10-18-2009, 11:19 PM
Thanks so much :) I had noticed the other thread after I posted this (sorry), but found your more 'stream-lined' css extremely helpful. Thankyou :)
iGeek
10-19-2009, 12:30 AM
:) No problem! Jem (http://www.jemjabella.co.uk) has a decent (albeit outdated) article on shorthand CSS (http://www.tutorialtastic.co.uk/tutorial/shortening_css_codes) if you want to read more. :)
PrincessSammy
06-10-2010, 03:09 AM
I'm having the same problem and I made the changes you suggested. Here is my .css -->
body
{ background: #000000;
background-image: url('http://www.chicpony.com/Chicpony.jpg');
background-repeat: no-repeat;
background-position: bottom center;
background-attachment: fixed;
What have I done wrong?