Site logo

[Resolved] Style H2 Inside Posts To Be Different To Standard H2 Styling

Home Forums Support [Resolved] Style H2 Inside Posts To Be Different To Standard H2 Styling

Home Forums Support Style H2 Inside Posts To Be Different To Standard H2 Styling

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2599832
    Jenny

    Hi, I would like to style my H2s inside any posts to look different to H2 anywhere else on my site.

    I’ve added some custom css to restyle the H2 and that works well, but I only want it to look like that in my posts.

    You can see via the link to a post on my website below, that the H2 have a light grey background which is exactly how I would like them to appear in my posts, but I don’t want that for my regular pages.
    Website Post Example

    This is the code I have in my additional CSS
    * h2 {background-color: #ebedf0; text-align: centre; padding: 15px 10px 15px 10px;}

    Is it possible to make this code ONLY for any H2s inside my post content?

    Thanks so much for any help. Much appreciated.

    #2599963
    Leo
    Staff
    Customer Support

    Hi there,

    Edit your CSS to this instead:

    .single .content-area .post h2 {
        background-color: #ebedf0;
        text-align: center;
        padding: 15px 10px 15px 10px;
    }

    Let me know if this helps 🙂

    #2600154
    Jenny

    That works perfectly thank you Leo.

    #2600162
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.