The Problem: The logo of my homepage (PNG format), is moving in a strange way in firefox (chrome works fine), while moving the cursor. It whobbles 5-10 pixel from left to right and back.
Under the PNG Image is the body linear-gradient background with background-attachment: scroll;
Notice: The image hovering works fine if the body background linear-gradient has the attachment fixed and if it is linear-gradient actualy. With normal background it even do not work too, also if the attachment is fixed.
I want to use linear-gradient and background-attachment: scroll;
The two examples in the comments do only work, because they have the background-attachment: fixed, as I listed in the css style here before. It was only for help to find out whats wrong, so i updated my post and make a fallback to attachment fixed.
If you want to see the problem please use PNG or GIF for the image and no placeholder.
Final question: Is there a way to have a PNG hovering through transition with opacity, while having a linear-gradient background for the body with background-attachment: scroll;
PS. backface-visibility: hidden; for the link or/and the image is not the solution!
FINALLY: After hours and hours, i found the solution here, below in the comment section. If you have the same problem, you have to use transform: translateZ(0); for the problematic image.
body {
background: linear-gradient(#edf6fa, #fbfbe9);
background-attachment: fixed; /*without it, the image whobbles*/
background-attachment: scroll; /*but this is what i need*/
}
#toplogoimg {
float: left;
}
#toplogoimg a {
position: relative;
}
#toplogoimg img{
opacity: 1;
transition: opacity 0.3s ease-in;
}
#toplogoimg img:hover{
opacity: 0.8;
transition: opacity 0.2s ease-out; /*transition is the bad guy, but not the main problem, because as I said with background-attachment: fixed; for the body it works fine, but only if it is a linear-gradient background.*/
}
<div id="toplogoimg">
<a href="index.html">
<img src="http://placehold.it/180x180" />
<!--The image src should be a PNG or GIF file. JPG works fine, but i need transparency.-->
</a>
</div>