Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outlook.com and Outlook on iOS and Android ignores max-width on images #93

Open
hteumeuleu opened this issue Jun 17, 2021 · 2 comments
Open
Labels
Outlook Windows, macOS, iOS, Android and Outlook.com

Comments

@hteumeuleu
Copy link
Owner

As reported several times over the past few weeks on the #emailgeeks slack, Outlook.com and the Outlook mobile apps have a new default style that resets the max-width property for images. Here's an example of the problematic rule seen on Outlook.com :

._3WlLk_4fUx7l0D6tu-MdWQ img {
    max-width: 100%!important;
}

A screenshot of developer tools showing the problematic code in Outlook.com

The solution would be to either revert your width and max-width (thus having width:150px; max-width:100%; instead of width:100%; max-width:150px; or setting the max-width to a non-image parent element.

This bug sounds very similar to #29.

@hteumeuleu hteumeuleu added the Outlook Windows, macOS, iOS, Android and Outlook.com label Jun 17, 2021
@nathankeenmelb
Copy link

I'm getting the following rule which is even stronger (more specific), after wrapping the entire email in <div id="root">:

#root img {
	max-width: 100% !important;
}

It's also the case that if the image doesn't have height:auto in it, Outlook iOS (at the very least - could not replicate anything for Outlook Android or Outlook.com) will add that rule inline on the <img>, with an !important.

koriblicek added a commit to koriblicek/Starcheck-emails-v1 that referenced this issue Dec 20, 2023
hteumeuleu/email-bugs#93
width and max-width changed their walues to fix image display on android outlook
@hteumeuleu
Copy link
Owner Author

Following a conversation with Courtney F. on Slack, this bug no longer seems present in Outlook.com (webmail). But I still see the problem in Outlook iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Outlook Windows, macOS, iOS, Android and Outlook.com
Projects
None yet
Development

No branches or pull requests

2 participants