Site logo

Archived topic

grid-container

3 replies · Started by Den on April 18, 2022

Viewing posts 1–4 of 4

Hello Team,

I am trying to achieve a CSS functionality on category pages where (if) the user hovers on the grid-container it should change the colour to grey.

I have successfully written the CSS lines but it also changes the colour of the main content area that I don't want. Can you help me out with this?

Thanks in advance.

Video Link: https://files.fm/f/kpwng6wtt

CSS :

.grid-container .inside-article:hover {
	background-color: #e0e0e0;
}

Hi there,

WordPress adds classes to the <body> tag that you can use to apply CSS to specific templates. So try this:

.blog .grid-container .inside-article:hover,
.archive .grid-container .inside-article:hover {
	background-color: #e0e0e0;
}

This should now only target that container on the blog and archive pages.

Amazing support as always <3

Glad to be of help!

This archived topic is closed to new replies.