WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Unwanted Inline styling (6 posts)

  1. zarzle
    Member
    Posted 1 year ago #

    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 http://www.maxdrach.com

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    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.

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

  3. zarzle
    Member
    Posted 1 year ago #

    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.

  4. zarzle
    Member
    Posted 1 year ago #

    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?

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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 http://wordpress.org/support/topic/remove-header-and-background-option-pages-in-twenty-eleven-child-theme?replies=11

    EDIT:
    correct spelling is important for !important

  6. zarzle
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic