Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

image background for header

Featured Replies

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);

}


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.

  • Author

Thats great thankyou very much for your help, ill go and change it now.

 

Cheers

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.