Site logo

Archived topic

Change Font Weight of Heading just on Posts

3 replies · Started by Rostyslav on November 3, 2022

Viewing posts 1–4 of 4

Hello,

I am using this code to change the font weight on all posts:

.single.single-post h2, .single.single-post h3, .single.single-post h4, .single.single-post h5, .single.single-post h6{
font-weight: 500;
}

Is there any way to combine that css in a shorter way or improve it?

Thanks!!!

Hi there,

modern browsers support the :is and :where pseudo properties that really help with that. Try:


.single-post :is(h2,h3,h4,h5,h6) {
    font-weight: 900;
}

Thanks

You're welcome

This archived topic is closed to new replies.