Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS background image (index.php)

    Basically i'll try and keep this short...

    I had an index.html file with the css rule (I'm using JQuery mobile)

    Code:
    .ui-page {
    
    background-image:url(image.png);
    }
    Everything worked fine. The image displayed perfectly.

    But know i've handed over the code to my group so they could implement some extra functionality and the index.html file is now index.php

    Now the image is not working.. but all other styling is. I've looked for solutions online but drawn a blank. Is there something i should be aware of here, when using php files?

    Thanks

  • #2
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    396
    Thanks
    2
    Thanked 30 Times in 30 Posts
    It may be that the image is not in the same directory as the php. So the image either needs to be moved or it needs to have the path added in the css.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #3
    New Coder
    Join Date
    Dec 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's in the same folder.. well it was originally in an images folder in the same directory but i've tried moving the image into the same folder but still no luck

  • #4
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    396
    Thanks
    2
    Thanked 30 Times in 30 Posts
    php should not have anything to do with it. It just generates the text of the page. the problem is either the browser or the server is not sending it. Are there any error messages in the console?
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello sambar89,
    Like COBOLdinosaur suggests, check your path. Have you tried using an absolute path yet? Just to verify the image will load that way.

    absolute/relative paths
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •