[Resolved] Change title background color in specific category?

Home Forums Support Change title background color in specific category?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #109309
    Are Martin

    I´m trying to change the background color (and also content background color) of the post title in a specific category with no luck. This is the CSS code I tried to use. The category-id is 108

    .category-108 .single .entry-title   {
        background: #f7f7f7;
    }

    What am I doing wrong here?

    Thankful for help!

    Are Martin Kallåk

    #109358
    Tom
    Lead Developer
    Lead Developer

    So close! The category class and .single class are both a part of the <body> element, so it would be:

    .category-108.single .entry-title   {
        background: #f7f7f7;
    }
    #161347
    Derek Binion

    Could I make all post title backgrounds the same color regardless of category with a similar code?

    #161365
    Tom
    Lead Developer
    Lead Developer

    For sure!

    If you’re targeting the post title on single posts:

    .single .entry-title {
        background: #f7f7f7;
    }

    If you’re targeting all posts titles (pages, posts etc..)

    .entry-title {
        background: #f7f7f7;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.