Jump to content

Recommended Posts

I'm new to PHP so I'm probably missing something simple but I can't figure it out. I need this urgently so I hope someone can help. The problem is when I browse my php pages, the css background images don't show up. The images in the body of the page show up fine, it's just the css background images.

 

The images that aren't showing are in the header and footer which are in include files.

 

Does php recognise images in a CSS file, what do I need to do to fix this.

Please help :'(

PHP has nothing to do with the CSS / images unless a php script is serving either or.

 

WIthout any code hard to help, but you probably wanted the CSS Section / Client Side section. Of course, unless PHP is actually dishing out / processing images or the css files.

My file structure is:

Folders          Files

CSS              - screen.css

Includes        - layout1.php

Images          - has images

index.php      -the page where images aren't showing

 

The attached files might make things clearer.

 

The css file won't attach but it's straightforward eg:

#header {

clear:both;

float:left;

width:100%;

height:175px;

border-bottom: 1px solid #000000;

background-image: url(images/dvdfflogo4.jpg);

background-repeat:no-repeat;

background-position: center;

background-color:black;

text-align: right;

}

 

Thanks for replying.

No Karl, the images folder has a lowercase i, anything else I could be missing?

 

It is not "suggested" but for testing purposes, try the absolute path to the image to see if that works. If it does, then it is a path issue.  Absolute path being  http://www.yoursite.com/images/image.jpg.  It is not suggested for CSS stuff for the reason that if you change domain names etc, you have to manually fix this.

 

If the absolute path works, try a variation of relative paths, as Karl suggested, but ../ may work as well etc. See if that fixes the issue. If, however, the absolute path does not work, something else is going on and the images are not where you are expecting them to be.

No that didn't work either. It's so strange I just can't see the problem. Thank you so much for trying to help. PHP is so hard. I have GD support enabled and when I view the file as a html it works fine so I thought it must have something to do with PHP and images in css. It's probably something obvious that I just can't see but it's definately a PHP problem or it wouldn't work as a html file.

Debbie:shrug:

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.