CSS Background Image

rocky.mcarthur41

New Member
Messages
2
Reaction score
0
Points
0
I'm trying to display a background image. On my pc this isn't a problem, when I upload the CSS to the server the image doesn't want to display.

#content-middle { padding: 0 25px 25px; background: url(../images/wallpaper.jpg) ; }
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
Have you uploaded the image to the server too and is it in the correct directory? If that's not the problem, can you provide a link to the page in question.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Wrong Category, moving to programming help
 

krofunk

New Member
Messages
216
Reaction score
5
Points
0
you could try using a complete path so rather than

Code:
#content-middle { padding: 0 25px 25px; background: url(../images/wallpaper.jpg) ; }

you could use

Code:
#content-middle { padding: 0 25px 25px; background: url(http://www.example.com/images/wallpaper.jpg) ; }

your code assumes that the images directory is a level up from your site, so in order for your page to display correctly all html files must exist in www.example.com/site/

using my example means that it doesn't matter where the index.html is...even if the image is on a different server.

hope this helps
 
Top