Mjml: object-fit support on mj-image

Created on 12 Sep 2019  路  4Comments  路  Source: mjmlio/mjml

It would be fantastic if we could use <mj-image object-fit="contain" /> or background-size support on <mj-image>.

Or is there a solution for that already?

All 4 comments

Hi @emilsedgh unfortunately object-fit is not supported by some major email clients like Outlook so we can't make it available in mjml.
What is your use case exactly ? We might be able to provide some solutions

We are using Grapesjs to offer an editing experience. The problem is that users create an <mj-image> and they upload a picture to it and it looks stretched out like this:

Screenshot_20190912_080536

I don't really get it, if you set the actual width it will keep the ratio, so it will works like an object-fit:contain ?

Hah alright let me try that. I'll close the issue for now and reopen if that makes sense. Appreciate your support and fantastic job on the project.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dalefish picture dalefish  路  89Comments

br4nnigan picture br4nnigan  路  18Comments

liminspace picture liminspace  路  29Comments

hilnius picture hilnius  路  18Comments

rgbjay picture rgbjay  路  90Comments