WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How can I disable css rule (10 posts)

  1. Daithy
    Member
    Posted 1 year ago #

    - I'm a noob to css.
    I'm using a theme with a background image, which I like, but I want to disable and swap it for a plain colour in my blog section--it's a bit choppy when scrolling. I have figured out the rule to add the colour, but I don't know how to disable the rule leading to the path of the png file.

    I have add this into my custom css, but it doesn't work!!

    body.custom-background {
    background-image: url("http://onlineteacher123.com/wp-content/themes/gridiculous/images/solid.png");
    background-repeat: repeat;
    background-position: left top;
    background-attachment: scroll;
    background-color: lightgray;
    }

    I know that it will work, if I somehow could tell the css console to override this rule
    background-image: url("http://onlineteacher123.com/wp-content/themes/gridiculous/images/solid.png");

    Thanks

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Try:

    body.custom-background {
    background-image: none !important;
    }
  3. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Oh wait a second, are you trying to change to another background image or get rid of it entirely?

  4. Daithy
    Member
    Posted 1 year ago #

    Just get id of it. If I wanted to change the pic, I'd only change the path (taking into account the path to be valid)

    Anyway, I'll try it now , and will let you know shortly

  5. Daithy
    Member
    Posted 1 year ago #

    Right, your code worked ;), but everywhere. It got rid of the background image in all the my pages. Somehow I'll have isolate just the one in the blog.

    onlineteacher123.com

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    See if this will work:

    body.blog {
    background-image: none !important;
    }
  7. Daithy
    Member
    Posted 1 year ago #

    Man you are so cool!! Totally worked! I was thinking of putting there the page id, I guess that'd also work.

    Thanks

  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Sometimes, yes, but in this case, the body tag only has the class of blog:

    <body class="blog custom-background">
  9. Daithy
    Member
    Posted 1 year ago #

    Thank you, I just notice that I have another problem. I installed a plugin a while ago, "custom fonts", and only now I have noticed that all the white borders around my pictures have disappeared, I de-activated the plugin, and it still remains as such. How do I tell my theme to start doing the nice white borders around my pics. Thanks

  10. Daithy
    Member
    Posted 1 year ago #

    That's all sorted, it was my fault. I had disabled a line in the actual style.css. I ran a comparison with the original and found the problem.
    http://www.alanhart.co.uk/tools/compare-css.php#CSSText

Topic Closed

This topic has been closed to new replies.

About this Topic