• Resolved Walton

    (@walton)


    My theme comes with headers on every post and page. I had gotten rid of these using the CSS code:

    #page-site-header {
    background-color:#fffcea;
    	background-image URL("none");
    	padding:100px 0px 50px 0px;
    	}

    Then I saw a broken link report for alphabetpublishingbooks.com/none.
    So I changed it to `#page-site-header {
    background-color:#fffcea;
    background-image none;
    padding:100px 0px 50px 0px;
    }`

    This made the headers come back. So then I reverted to the original code, but the page and post headers are still there. What am I missing?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • background-image: none !important;

    give that a try

    Hi Walton,
    Sorry to hear about your issue. You missed a “:” after background-image. It should be written as “background-image: none” but you have written as background-image none which is incorrect way.
    For more clearification.

    Here is your code….
    #page-site-header {
    background-color:#fffcea;
    background-image none;
    padding:100px 0px 50px 0px;
    }`

    It should be written as…
    #page-site-header {
    background-image: none!important;
    }`

    Let me know if it will works. Thanks

    • This reply was modified 3 years, 2 months ago by Kausar Alam.
    Thread Starter Walton

    (@walton)

    Thanks for noting the colon error. I did have it correct in my code, but the ‘!important’ worked.

    Out of curiosity, why does it need to be ‘!important’? One of the things that drives me nuts about CSS is those little things like that. Sometimes you need to do it this way or that way, sometimes you don’t!

    @walton a script is adding the background-image to that div so the code is inline. That will override your CSS in a style sheet. The !important, makes your CSS more, well… important thus overriding the inline style.

    Thread Starter Walton

    (@walton)

    a script is adding the background-image to that div so the code is inline. That will override your CSS in a style sheet. The !important, makes your CSS more, well… important thus overriding the inline style.

    Got it. Thanks for explaining that.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CSS code for no header images suddenly not working’ is closed to new replies.