PDA

View Full Version : Background Trouble in Dreamweaver MX...



lead_diet
13 Apr 2006, 07:42 PM
I'm having a slight problem with my CSS backgrounds in Dreamweaver. I'm using Dreamweaver MX and my background URLs are not working. I have the image's URL listed like so:

body {
background-image: url ('MainImages/back.jpg');
background-repeat: repeat;
}

I have it as a relative link because I don't want the absolute link (for my hard drive) to be used when I inevitably move the site onto the Internet in the future, but I want to be able to preview my work as I go locally. I have the capital letters in there because I couldn't remember if CSS was case sensitive or not. Is it a problem with viewing my code locally or am I missing a piece of my CSS code for the background image to be displayed properly?

Wickham
14 Apr 2006, 01:02 AM
First, check that the folder structure is the same at your host as it is on your computer. I can't tell where your html file is in relation to the mainimages folder. You may need to code the image as ../mainimages/back.jpg or one of the other variations like ./mainimages/back.jpg or just back.jpg.

It's useful to set up your computer as precisely the same folder structure so that you can view online or on computer without changing the link. Set up a main folder to correspond with the host root folder , then the same subfolders.

Secondly, yiou are right to think about capitals. I could not work out why my images were not showing when online until I realised that my isp's server was case-sensitive. IE doesn't care so they showed on my computer.

I also discovered that one of my photo software programs had a habit of saving a jpg file as JPG where I had coded everything in lower case (a must with xhtml).