• Resolved zarzle

    (@zarzle)


    Hi, I am working on a child theme for the twentyeleven theme for my website maxdrach.com

    Everything was working fine, except I accidentally used the wordpress dashboard to change the background color. It seems to have added some code to the html document (or php, wherever it is stored) that changes the background color, overriding my child theme.

    In firebug, it looks like an extra style sheet called “inline” under maxdrach.com/

    In the html, it is inline style code at the very end of the header that looks like this:

    body.custom-background {
        background-color: #0DB306;
    }

    Why did it do this and how do I get rid of this?
    It was working fine before, so I want to just undo this. My website is https://www.maxdrach.com

Viewing 5 replies - 1 through 5 (of 5 total)
  • In the child theme style.css just add the color you desire it to be

    body.custom-background {
    background-color: #ffffff !important;
    }

    #ffffff is white.

    https://www.w3schools.com/cssref/css_colors.asp

    Thread Starter zarzle

    (@zarzle)

    Thanks for your quick response!

    Adding the ‘!important’ in background section of the child theme did work to change the background color, overriding this “inline styling” or whatever it is that was added to my website.

    Do you know where this inline styling, that I talked about in my first post, is coming from and how I would be able to get rid of it? I did not have it until I edited the background in the dashboard feature.

    I don’t want to start having to add ‘!important’ to all of the code in my child theme.
    Thanks.

    Thread Starter zarzle

    (@zarzle)

    Actually, SeacoatWebDesign, your solution is not working! It only works when pasted in Firebug, and does not work when uploaded into the child theme!

    Do you have any other ideas on how to fix my this problem?

    the background is set within
    dashboard – appearance – background
    which creates the mentioned embedded style.

    set a color of your choice or upload an image for the background under that option.

    if you absolutely do not want that background option, read https://www.ads-software.com/support/topic/remove-header-and-background-option-pages-in-twenty-eleven-child-theme?replies=11

    EDIT:
    correct spelling is important for !important

    Thread Starter zarzle

    (@zarzle)

    Thanks alchymyth!
    I was spelling ‘important’ wrong. Silly me.
    And, that other thread has the solution that I was looking for originally.
    Thanks again!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Unwanted Inline styling’ is closed to new replies.