WordPress.org

Ready to get started?Download WordPress

Forums

Background color can change but background can't change to an image (6 posts)

  1. blaircombine
    Member
    Posted 1 year ago #

    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.

  2. paulwpxp
    Font hero
    Posted 1 year ago #

    Validate the markup and correct the misplaced quotes.
    http://validator.w3.org/

  3. blaircombine
    Member
    Posted 1 year ago #

    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!

  4. paulwpxp
    Font hero
    Posted 1 year ago #

    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;">
  5. blaircombine
    Member
    Posted 1 year ago #

    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?

  6. paulwpxp
    Font hero
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic