CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 24th, 2003, 07:33 PM
fgeller's Avatar
fgeller fgeller is offline
:(){ :|:&};:
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Germany
Posts: 297 fgeller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 4 m 52 sec
Reputation Power: 5
Send a message via ICQ to fgeller
CSS: Background Image Path

Hi there

I have a probelm linking to a background image using CSS. I am using this line:

background-image:url('/path/back01.gif');

"path" is the direct path underneath localhost. The picture shows up when I am trying the view it with my browser (http://localhost/path/back01.gif) . But in my PHP File it doesn't. I am using the direct path because the paths of my PHP File are a bit confusing - so I thought it would be easier, but it doesn't work. I am having a php file, that includes other php files with functions, and these functions include the stylesheet:

index.php
|-include
|+-functions.php
||-stylesheet.css
|-images
|+-back01.gif


index.php should show the background image, the stylesheet links to the image and the stylesheet is printed into the index.php by the functions, I mean it is linked.

Do I have to specify the path for the background-image option so that I recognizes it that it is a direct path?
Thanks for taking your time
__________________
regards >_<

ws. fgeller.de
em. felix@fgeller.de

Reply With Quote
  #2  
Old August 25th, 2003, 06:06 AM
ibidris2003 ibidris2003 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 249 ibidris2003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
How are you linking to the stylesheet? Probably the php server cant find your css file.


http://galileo.spaceports.com/~ibidris/

Reply With Quote
  #3  
Old August 25th, 2003, 06:13 AM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,670 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 4 Days 6 h 10 m 50 sec
Reputation Power: 1618
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
The path should be relative to where the css file calling the image is.


Lets say you have the set up:

http://localhost/path/index.php
http://localhost/path/images/back01.gif
http://localhost/path/styles/stylesheet.css

If you are importing or calling a CCS in index.php you path in the css to the image would be:

background-image:url('../back01.gif');

Alternatively, you could use full URL.

HTH

Jamie
__________________
Cheers,

Jamie


# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure

# Any form of employment is strictly prohibited ......


__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.

__________________

Reply With Quote
  #4  
Old August 25th, 2003, 10:23 AM
fgeller's Avatar
fgeller fgeller is offline
:(){ :|:&};:
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Germany
Posts: 297 fgeller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 4 m 52 sec
Reputation Power: 5
Send a message via ICQ to fgeller
Hmm I am pretty sure that my Server can find the CSS file, as nothing would be formatted on the whole page without it.

jabba_29:
The direct and full path would be the "safer" way. By that I mean that it should work 100% right? I was using the way that you ary saying, relative to the location of the css stylesheet not the php file, but still it didn't work. But as I said the direct path shows up the picture, how can I put the full path into the url? as url("http://localhost/path/images/back01.gif");
doesn't work.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS: Background Image Path


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway