Answer the question
In order to leave comments, you need to log in
Responsive layout of html emails in gmail. How?
Hi all!
Here I was puzzled by the layout of the html-mailing, which is buggy displayed in gmail. There's something like this:
@media screen and (max-device-width: 640px), screen and (max-width: 767px) and (-webkit-min-device-pixel-ratio: 1.5), screen and (max-width: 767px) and (-o-min-device-pixel-ratio: 3/2), screen and (max-width: 767px) and (min--moz-device-pixel-ratio: 1.5), screen and (max-width: 767px) and (min-device-pixel-ratio: 1.5) {
.desktopversion { display: none !important; }
.mobileversion { display: block !important; float: none !important; width: 100% !important; height: auto !important; }
}
@media screen and (min-width: 641px) and (-webkit-max-device-pixel-ratio: 1.0), screen and (min-width: 641px) and (-o-max-device-pixel-ratio: 1/1), screen and (min-width: 641px) and (max--moz-device-pixel-ratio: 1.0), screen and (min-width: 641px) and (max-device-pixel-ratio: 1.0), screen and (min-width: 768px) {
.desktopversion { display: block !important; }
.mobileversion { display: none !important; }
}
<div class="desktopversion" style="display: block;">
///
</div>
<!--[if !mso]> -->
<div class="mobileversion" style="display: none; float: left; width: 0; overflow: hidden;">
///
</div>
<!-- <![endif] -->
Answer the question
In order to leave comments, you need to log in
No way. Gmail (mobile client) does not support media queries.
Layout rubber tables, where possible.
PS: Letter layout designer, 5 years experience.
PPS: It means the most cross-platform solution.
Forget about two versions of the letter. Do one. rubber tables. The gmail app does not understand media queries. The link to my framework has already been given above. There is a letter template that you can turn around for understanding. Sergey Goryachev says everything correctly.
perhaps gmail uses important, while you understand your settings are ignored.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question