CSS transition effect makes image blurry / moves image 1px, in Chrome?
2020 update
- If you have issues with blurry images, be sure to check answers from below as well, especially the
image-rendering
CSS property. - For best practice accessibility and SEO wise you could replace the background image with an
<img>
tag using object-fit CSS property.
Original answer
Try this in your CSS:
.your-class-name {
/* ... */
-webkit-backface-visibility: hidden;
-webkit-transform: translateZ(0) scale(1, 1);
}
What this does is it makes the division to behave "more 2D".
- Backface is drawn as a default to allow flipping things with rotate
and such. There's no need to that if you only move left, right, up, down, scale or rotate (counter-)clockwise. - Translate Z-axis to always have a zero value.
- Chrome now handles
backface-visibility
andtransform
without the-webkit-
prefix. I currently don't know how this affects other browsers rendering (FF, IE), so use the non-prefixed versions with caution.
image blurs during CSS transition and is janky
Seems like Chrome specific issue.
Instead of transform:scale()
you can animate width
:
.caption:hover > span img{
background: rgba(0, 158, 205, 0.45);
transform: translate(0,10%) ;
width:100%;
}
transform + transition causes jump or blurry content CSS
Seems there are some problem in the animation (CSS transition effect makes image blurry / moves image 1px, in Chrome?)
I'll let the text outside the transform
's element.
- put your
.button
inside.diamond
- move
.inner-diamond
to be a sibling of the.diamond
, give it aopacity: 0
(remove.diamond-content
'sopacity:0
) - set
pointer-events:none
to the.inner-diamond
use sibling method to fulfill it
.diamond:hover + .inner-diamond {
opacity: 1
}
a quick demo(layout not pretty):
http://jsfiddle.net/r1kw37g5/6/
CSS Transition causing images in a tags to jump in chrome
At first see this answer enter link description here
The second, try to check element width, if it's 300.12px (float number width), try to fix width so it would be rounded.
Sometimes this problem dissapear after applying position:relative to the image.
Chrome has bugs. So there could be other solutions, and problems with that. It might be so, your case has no solution. Like round corners + zoom animation.
Related Topics
What Is a User Agent Stylesheet
Is Quoting the Value of Url() Really Necessary
Difference Between Normalize.Css and Reset Css
Column Order Manipulation Using Col-Lg-Push and Col-Lg-Pull in Twitter Bootstrap 3
Rotated Elements in CSS That Affect Their Parent'S Height Correctly
Css Attribute Selectors: the Rules on Quotes (", ' or None)
Set Size on Background Image With Css
Difference Between "Screen" and "Only Screen" in Media Queries
How to Style Child Components from Parent Component'S CSS File
Setting Element Width Based on Height Via Css
How to Use /Deep/ or ≫≫≫ or ::V-Deep in Vue.Js
Nth-Child Doesn't Respond to Class
Detect If an Input Has Text in It Using CSS - on a Page I Am Visiting and Do Not Control
How to Avoid Extra Blank Page At End While Printing