Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image WOn't Display 1

Status
Not open for further replies.

Petrolhead

Technical User
Mar 13, 2009
27
0
0
I'm having troulbe displaying a background image on my banner div.

I'm using the following code.

Code:
#banner{ 
  background-image: url(Images\banner.jpg);  
  height: 110px;
  border: 0;
  margin: 0;
  padding: 0;
  text-align: center;
  color: White;
}

I've tried putting a .\ before the Image folder and renaming the extension to jpeg to no avail, still won't appear in any browser.

Can anyone suggest where I might be going wrong?
 
I think I may have a path issue but not sure how to get around it.

My web site is structured as follows:

Root\CSS\CSS files
Root\Images\Image files

Troulbe I'm not sure how to construct a path relative to the CSS file, even the full drive location doesn't work.
 
Hi

First, you have to use forward slashes ( / ) in path. Second, parent directory is denoted by two dots ( . ), one means current.
CSS:
background-image: url([COLOR=red pink]../[/color]Images[COLOR=red pink]/[/color]banner.jpg);
Then read Syntax and basic data types | Values | URLs and URIs in the CSS 2.1 specification.



Feherke.
 
Many thanks for the helpful reply.

I never fully understood what the dots were for, makes a lot more sense now, ,and I've been able to get all the image links working.

Thanks again. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top