May 1, 200917 yr hi guys, quick question i want an image i designed in photoshop to be a background image for my header but when i put my code in my css i doesnt show for some reason, i tried changing things around but no joy can you help. Below is the section of code i have written out for my css please tell if its wrong and what i should change cheers guys #header{ height: 150px; background-image: url(C:\Documents and Settings\Luke\Desktop\photoshop\Bannercopy.jpg);}
May 1, 200917 yr C:\Documents and Settings\Luke\Desktop\photoshop\Bannercopy.jpg is an absolute path pointing to a file on your computer. This won't me much good when you move the site on a web host as the folder structure on the host will be completely different, your image won't be where you are pointing it to. Instead use a relative path, if you have your index page and jpg in the same folder you can just use: background-image: url(bannercopy.jpg); That just says the image is in the same place as the .html file To keep things tidy it is best to keep your images in there own folder (in the same folder as your index page). If you call this folder images your code would be: background-image: url(images/bannercopy.jpg); If your site is online you can also use an absolute path which points to exactly where the file is: background-image: url(http://www.mywebsite.com/images/bannercopy.jpg); The problem with this is if you ever change the structure of you site or want to change to a different domain you would need to change every instance of this in the code.
May 1, 200917 yr Author Thats great thankyou very much for your help, ill go and change it now. Cheers
Create an account or sign in to comment