Site logo

Archived topic

How to underline headlines only in posts

3 replies · Started by David on March 7, 2022

Viewing posts 1–4 of 4

Hi,

i would like to underline my h2 and h3 headline with a 6px high line.
But only in the blogposts.

I tried
.entry-content h2 {
border-bottom: 1px solid #7EC8D1;
}

but then the underline are on every page.

Thank you,
David

Hi David,

To clarify: By blog post, did you mean the headline for the actual blogs on its own single post page?

If that's the case, you can try adding body.single to the selector.

Example:

body.single .entry-content h2, body.single .entry-content h3 {
border-bottom: 1px solid #7EC8D1;
}

Thank you Elvin,
that worked very well.

No problem. :D

This archived topic is closed to new replies.