0

I'm using Jetpack to lazy load images and wanted to fade in them nicely using CSS. I've tried adding the following CSS in my theme:

.jetpack-lazy-image {
    opacity: 0;
    -webkit-transition: .3s;
    transition: .3s;
}

.jetpack-lazy-image--handled {
    opacity: 1;
}

but that doesn’t work. I've also tried to add this to the default WP themes, however, it doesn't work as well. Could someone please let me know what I am missing?

Thank you.

0

Which part doesn't work? You might need to change your transition property to include a name, as well as a delay. Optionally add the timing:

.jetpack-lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

https://developer.mozilla.org/en-US/docs/Web/CSS/transition

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.