Site logo

Archived topic

H2 Styling

5 replies · Started by Edin on November 9, 2018

Viewing posts 1–6 of 6

This might be a stupid question, but I want to style the h2 titles differently on the Blog-Homepage (the one that lists all articles), and h2 titles within a single post or page.

How do I do that?

What I have now is h2s styled with the customizer and a line on css added to the custom.css.

How do I separate them?

Thanks in advance!

Hi there,

You can use the Customizer > Colors > Content > Blog Post Title and Blog Post title hover

David, you misunderstood.

What I want to do is style the H2 headlines differently:

- one size on the homepage (blog articles list)
- another size when used within posts and pages

How do I do that?

Thanks,
Edin

So keep the customizer option for blog page, then this HTML in posts and pages:
<h2 class="special">Special h2 style</h2>

Then just target it with some CSS:

h2.special {
    font-size: 20px;
    color: #fff;
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Let me know if this helps :)

Leo, thank you.

In the meantime I found a solution that seems to work:

.entry-content h2 {font-size: 32px;}

Yup that will work too :)

This archived topic is closed to new replies.