The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
Hi,
is there a possibility to activate the "object-fit: cover" function in the rich Text Editor of Canvas?
I tried to crop an image there. In the preview it worked, but when saving/publishing, the image was again only rescaled and the "object-fit" flag in the style disappeared.
See my example below. Please insert an image of choice.
<img id="2442165" style="width: 1200px; height: 200px; object-fit: cover;" src="/courses/16078/files/2442165/preview" alt="BorasSteel_140.jpg" /> the preview can be seen in the "cropped_image.png"
when saving (Updatera Kursöversikt) the object-fit flag disappears and the image is only scaled. (scaled_image_after_saving.png)
Best
Andreas
@AndreasKrauseDogNeedsBest wrote:Hi,
is there a possibility to activate the "object-fit: cover" function in the rich Text Editor of Canvas?
I tried to crop an image there. In the preview it worked, but when saving/publishing, the image was again only rescaled and the "object-fit" flag in the style disappeared.See my example below. Please insert an image of choice.
<img id="2442165" style="width: 1200px; height: 200px; object-fit: cover;" src="/courses/16078/files/2442165/preview" alt="BorasSteel_140.jpg" /> the preview can be seen in the "cropped_image.png"
when saving (Updatera Kursöversikt) the object-fit flag disappears and the image is only scaled. (scaled_image_after_saving.png)
Best
Andreas
Hello,
The “object-fit: cover” function is not supported by the rich text editor of Canvas. This means that the style attribute will be removed when you save or publish your page, and the image will be rescaled to fit the container. This is a known issue that has been reported by other users.
There are some possible workarounds that you can try to crop your image and keep the aspect ratio:
I hope this helps you solve your problem.
If you have any further questions.
Please feel free to ask. Have a nice day!
Best Regard,
BookerE1
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in