I created a Lottie animation, which animates on scroll in my website. In this Lottie’s settings, I’ve switched the render settings to “Canvas”, instead of using the default “SVG” (this prevents flickering in Firefox browsers).
With the “SVG” render setting, the Lottie fills the parent div, however, with the “Canvas” render setting, the animation always has a white border. I’ve tried to fix this using both Webflow and custom code to no avail.
Does anyone know how to make this Lottie completely fill the parent div (eg, in the same way that " background-size:cover" would work in CSS)? Many thanks for any advice!
As I have it now, it seems to scale fine with viewport size. I just can’t seem to get the image (with colored background) to fill out the div. It works great when the ‘SVG’ option is selected, but changing the rendering from ‘SVG’ to ‘Canvas’ is affecting it in some way which I can’t figure out.
The Lottie I have on there now is about 3.3M, composed of 114 frames.
You have a really cool lottie animation man it looks awesome. I think you can’t get the full width when using canvas because canvas maintains the aspect ratio of your animation. So try giving your lottie animation a width of 120%, it would look bigger but it will cover the full width. I hope this helps.