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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts

    css background image error

    I have coded a background image in a table using css following a tutorial, but When I test it I get an error saying I need to add a ',' or ';' in the string somewhere

    Here is what I have:

    Code:
    <table border="1" width="100%" style="background-image:url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg');
    background-repeat: no-repeat; background-attachment: fixed; background-position: right, bottom">
    I appreciate the help

  • #2
    Regular Coder
    Join Date
    May 2008
    Location
    Lost in Localhost...
    Posts
    702
    Thanks
    3
    Thanked 43 Times in 42 Posts
    Code:
    <table border="1" width="100&#37;" style="background-image:url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg');
    background-repeat: no-repeat; background-attachment: fixed; background-position: right, bottom;">
    Try that

    If you didn't notice what I did, I added a semi colon here:

    Code:
    background-position: right, bottom;

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    background-position doesn't take comma-separated values, and as far as I know a final semi-colon is implied. Try
    Code:
    
    background-position: right bottom;
    

  • #4
    Regular Coder
    Join Date
    May 2008
    Location
    Lost in Localhost...
    Posts
    702
    Thanks
    3
    Thanked 43 Times in 42 Posts
    Yeah, take the comma out of the code I gave you

  • #5
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts
    Thanks for the help, I have made those changes, but still I have the same problem.

    Anything else you can think of?

    on a side note: I am using php to echo the css, will this cause a problem with background images?

    The reason I am php to echo it, is bc this is the only I was able to make the include function on it work
    Last edited by surreal5335; 07-18-2008 at 10:18 PM. Reason: another thought

  • #6
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    um, link to page?

  • #7
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts
    sure:

    mwebbuilder.x10hosting.com

    Thanks for the help


    sorry about that I realize now that I need to take out the troublesome code in order for you to see anything useful
    Last edited by surreal5335; 07-18-2008 at 10:37 PM. Reason: light bulb turned on

  • #8
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    So...where would it be?
    You'd probably be better off leaving it in so we can fiddle with it.

  • #9
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts
    I left a comment on it including the bad code at the end of the <head> tag
    Hope this helps
    Thanks

  • #10
    Regular Coder
    Join Date
    Jul 2008
    Posts
    195
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Code:
    echo' function
    try changing it to this:

    Code:
    echo 'function'

  • #11
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts
    that part you are refering to is inside the comment brackets. The actual code thats causing the problem which is giving me an error to add a ',' or ';' in it is strictly css on the exact line below it. The line of that is to tell you where I am trying to plug it in (the first table tag)

    Sorry for the confusion

    My code now looks like all the tutorials I have found on the internet to processing background images, so im rather clueless as to why I and where I need to add a comma or semi-colon. Apparently somehwere in that string of css

    Thanks for your help in this matter

  • #12
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    OK I could be way off here but, I am not familair with using css inside js tags.

    And in the source code of your html page, there is no echo tag so it is hard to relate that comment with the actual script.

    Should the css not be enclosed with this tag like this

    Code:
    <script type="text/css>
    
    table {
    background-image: url('http://i95.photobucket.com/albums/l136/surreal5335/RE&#37;20site/Fotolia_2695889_XS.jpg');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: right bottom;
    }
    
    
    </script>
    forgive me if I am wrong

    bazz
    Last edited by bazz; 07-19-2008 at 03:08 AM.
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #13
    Regular Coder
    Join Date
    Jul 2008
    Posts
    195
    Thanks
    3
    Thanked 11 Times in 11 Posts
    It is your first post that got me to say that.

    You said that the page returned an error during testing.

    Browsers IGNORE HTML and CSS errors. However, if the PHP is wrong, it will be incorrectly parsed by the server, and the browser WILL return an error.

    I ran your code snippet you gave us through Dreamweaver 3 times. It returned no errors. I also tried the page in my browser, locally too. Nothing.
    Last edited by macwiz; 07-19-2008 at 03:31 AM.

  • #14
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    I don't understand how you're knowing you need to add a semi-colon or whatever? I just looked at the tagsoup code and it'll work.

    BTW, html comments aren't ended with --!> They end as -->

    Code:
    <table border="1" width="100&#37;" style="background-image: url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-position: right bottom;">

  • #15
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts
    interesting, so it sounds like this maybe a php problem if any at all? Ill turn off firebug and see if that solves my problem.

    Thanks a lot for all your help


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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