Support » Themes and Templates » Background color can change but background can't change to an image

  • Hello everyone!

    I am a nube to wordpress.org and trying to learn code while learning wordpress!

    Please help!

    My test website for my clients is http://www.blaircombine.com

    Here’s my situation:

    Theme: pinboard

    Problem: I was able to change the very back background of the website which has the swampy look with trees to it, but I can’t change the background to an image for the main body which is currently the tan section. I am able to change the color on the css file but it won’t let me change it from “background-color” to “background-image.”

    Here’s the code for just a color and an image:

    /* Background is solid color (which works) */
    .entry,
    #comments
    #respond {
            background-color: tan;
             }
    
    /* Trying to change background color to an actual image */
    .entry,
    #comments
    #respond {
            background-image: url('http://www.blaircombine.com/wp-content/themes/pinboard/images/header.png');
             }
    
    /* ---- After I update it for the image, It manipulates my code to this ---- */
    .entry,
    #comments
    #respond {
            background-image: url('http://www.blaircombine.com/wp-content/themes/pinboard/images/header.png');
    
    /* ^Notice the "&#039 two times in the url^ */

    Any help or advice would be greatly appreciated!

    By the way, I am sure the pathway is correct.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Validate the markup and correct the misplaced quotes.
    http://validator.w3.org/

    Thread Starter blaircombine

    (@blaircombine)

    Thanks for the response!

    Just looked at this link, but I’m not exactly sure if I’m using it properly.

    Could you explain a little more about how to use it?

    And I’m still learning the terminology…. so could you please put “validate the markup and correct the misplaced quotes” in Lamen’s terms for me please?

    Thanks for your patience!

    The markup validator is to help checking if there is anything wrong with the html markup. You would look for things like misplaced code, unclosing tag, anything that will mess up the output.

    To use that service, just go there and put in your site’s url and read the result, and see if anything major should get fixed.

    I could see this in your markup (and few others.)

    /images/header.png" style=width:"300px;height:280px;">
    Thread Starter blaircombine

    (@blaircombine)

    Ah, I see.

    I’m curious though because some of the items it is referring to doesn’t seem to be messing up? Could it work even though the validator says there is an error?

    And any idea why the background can change color just fine but not to an image?

    Could it work even though the validator says there is an error?

    That validator is of W3C
    http://www.w3.org/Consortium/

    It’s great to see a website passes validation, but not all the errors and warnings should get fixed. W3C is not the world standard, it’s just a group of people working together.

    It’s important that your site is free from markup errors, that’s the reason to check with validator, we will only focus on the major stuff, things like unclosing tag or misplaced code for example.

    A website might contain markup errors but still viewable by browsers because browsers forgive it but not all the browsers do the same and some markup errors will effect javascript and css.

    And any idea why the background can change color just fine but not to an image?

    Right now, in firebug, I see all the tags that should be in <head> placed in <body>. When “view page source” with browser, I see <img> tag just under opening <head> before <meta charset>, and that <img> tag has a misplaced quote in its attribute.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Background color can change but background can't change to an image’ is closed to new replies.