I’m trying to make it so that when you mouse over an area on the screen, the background image gets darker and text appears. I currently have a column with a background image and a text element on top of that. I added a class to the text and the following CSS
.my-image-class:hover {
content: url(my.image.jpg);
z-index: 999;
width: 100%;
display: inline-block;
}`
The issue is that it completely replaces the background image and puts in a poorly formatted version of the image.
-
How do I format the image so that the hovering image has the proper dimensions?
-
How do I make the content text instead of an image?