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

AustinTruex68 picture AustinTruex68  路  4Comments

lucasnantonio picture lucasnantonio  路  4Comments

tobystokes picture tobystokes  路  3Comments

valstu picture valstu  路  3Comments

hellfish2 picture hellfish2  路  4Comments