Site logo

Archived topic

Background colour on Single post

3 replies · Started by Paul on November 21, 2022

Viewing posts 1–4 of 4

Hi There,

I have this CSS to update the BG Colour on archive pages

/* Background colour on archives */
body.archive {
background-color: var(--grey-100);
}

I'd like to do the same on single posts - how do I target the single post in the CSS?
See example URL in private info.

Cheers
Paul

Hi there,

try:


body.single-post {
    background-color: var(–grey-100);
}

If you want the same color for the single post and archive then you can combine the:


body:is(.archive, .single-post) {
    background-color: var(–grey-100);
}

Perfect - thank you David!

Paul

You're welcome

This archived topic is closed to new replies.