We have a website with elements which have background images, and their parent has a different background image. On mouse over (:hover) the background changes to a specific color. The problem is that the change does not happen immediately, and for a fraction of a second the background becomes transparent and the parent background is visible. I want to make the change happen immediately, or at least make the background change from the image to the specific color without being transparent (if it's not transparent then I don't mind to keep the effect). How do we do it with CSS (I prefer without JavaScript)?
Here is our CSS code:
.main_block .items_block .items_container .thumbnail {
border: 1px solid #cdced0;
border-radius: 3px;
padding: 5px 3px 10px;
float: left;
background-size: cover;
background-position: center center;
}
.main_block .items_block .items_container .thumbnail:hover,
.main_block .items_block .items_container .thumbnail.active_thumbnail {
border: 1px solid #FCC20F !important;
background: #F9F158 !important;
background-size: cover !important;
background-position: center center !important;
}
.main_block .items_block .items_container .thumbnail {
background-image: url([some url]);
}
By the way, without background-position: center center !important;
in .thumbnail:hover
, the background image also moves on mouse over.