Confused on Custom CSS

  • Mike
    Mike
    Senior Member 130 points
    September 2, 2013 at 4:06 am

    I want to change the background color for the block titles, thinking that this css will do the trick.

    .block-title {
    background: url(“img/title-bg.png”) repeat-x scroll left bottom #EAF7FF;
    }

    so I paste that at the end of my New Css Styles section and no change.
    When I use the firefox inspect element function this is what I see.
    So I don’t understand why my custom css is crossed out presumably overridden by other css code.
    I thought what I put in New Css Styles area always took precedence.
    Here is what the inspector shows.

    Attachments:
    You must be logged in to view attached files.
  • yosef
    yosef
    Newbie 92 points
    September 2, 2013 at 5:23 am

    use
    .block-title {
    background-image: url(“img/title-bg.png”) repeat-x scroll left bottom #EAF7FF;
    }

  • Mike
    Mike
    Senior Member 130 points
    September 2, 2013 at 6:12 pm

    Thanks for the suggestion, but no difference.

    I decided to just make a new title-bg.png file the color I needed, and that did the trick.

  • Richard Bonk
    Richard Bonk
    Super Guru 2,739 points
    September 2, 2013 at 8:18 pm

    If you want to make sure that your css definition has higher priority over other css declarations you need to add “!important” to it. So your css example would look like this:

    [code title=””].block-title {
    background: url(“img/title-bg.png”) repeat-x scroll left bottom #EAF7FF !important;
    }[/code]

  • yosef
    yosef
    Newbie 92 points
    September 2, 2013 at 8:32 pm

    Mike
    Be strong and never give up 🙂
    just use !important as richard said

  • Mike
    Mike
    Senior Member 130 points
    September 2, 2013 at 8:45 pm

    Thanks Richard, I feel like I am back in charge again.

  • Mark Fail
    Mark Fail
    Super Guru 13,013 points
    September 4, 2013 at 4:50 am

    🙂

Viewing 7 posts - 1 through 7 (of 7 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes