Archived topic
Search results Background-Colour
5 replies · Started by Paul on January 17, 2023
Hi There,
I'd like to change the search results inner container background colour without effecting the background colour of other pages (I already have the following styles in place). Do you know which selector I could use to target the inner container (link in private info)
/* Background colour on archives */
body.archive {
background-color: var(--grey-100);
}
/* Background content colour on archives */
body.archive, body.archive #page {
background-color: var(--grey-100)
}
/* Background colour on single posts */
body.single-post {
background-color: var(--white);
}
Hi Paul,
When you say inner container, do you mean the body background color (based on your CSS)?
If so, you can use body.search-results
Hi Ying,
Thanks for helping.
No I meant the background colour behind the cards:
The CSS below does what I want but it also effects the bg color on the single-posts page which I don't want :)
.one-container .site-content {
background-color: var(--grey-100);
}
Thanks
I see, you can use the class I mentioned to target the search results page:
body.search-results .site-content {
background-color: var(--grey-100);
}
Perfect thank you Ying :)
You are welcome :)