Hello,
I am attempting to use the following to add text over my image: https://theme.co/apex/forum/t/image-overlay-with-text/24600.
However, I only want the text to appear when I hover, and also, when hovering, I would like the image to blur slightly so that the text becomes more readable. Here is the code I am currently using (mostly copied from the above link):
JS:
jQuery('.textoverimage').each(function() {
jQuery(this).append('<span class="img-desc">' + jQuery(this).find('img').attr('alt') + '</span>');
});
CSS:
.textoverimage:hover {
-webkit-filter: blur(4px); /* Chrome, Safari, Opera */
filter: blur(4px);
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: bold;
font-size: 20px;
color: white;
text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}
I would like the text to inherit my font, and to be centered on the image as well. Any help would be appreciated. It sort of works, but I’m missing something. Thanks!
Jon