Support » Fixing WordPress » CSS code for no header images suddenly not working

  • 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 4 replies - 1 through 4 (of 4 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 2 days, 13 hours 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.