jeyversee
New Coder
Hi all, I am using this code from cargo support for my cargo website. I have a button on the upper left of my website and I want it to show a different image that goes right on top of the button.
The code here places the hover image right at the centre. I was wondering if anyone could tell me what to change from the original css?
Here is what it says:
Here is the link for the full code:
https://support.cargo.site/Show-an-Image-on-Hover
Thank you
The code here places the hover image right at the centre. I was wondering if anyone could tell me what to change from the original css?
Here is what it says:
CSS:
.hover-title {
display: inline;
pointer-events: auto;
cursor: pointer;
}
.hover-image {
visibility: hidden;
}
body:not(.mobile) .hover-title:hover + .hover-image {
visibility: visible;
pointer-events: none;
}
.hover-image {
display: flex;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: -1;
pointer-events: none;
flex-direction: column;
align-items: center;
justify-content: center;
/* Change width and height to scale images */
width: 90vw;
height: 90vh;
}
.hover-image img {
max-width: 100% !important;
max-height: 100% !important;
width: auto !important;
height: auto !important;
margin-bottom: 0;
}
Here is the link for the full code:
https://support.cargo.site/Show-an-Image-on-Hover
Thank you
Last edited by a moderator: