Content area trouble with outlook ( <!--if mso]>

hi there,
i’m stuggling with outlook, i’m trying to make a responsive newsletter but it’s really difficult to code all soft/apps/device/resolution…
so, to do this i try to use for outlook the <!–if mso]> balise, but when a data is in the balise, they doesn’t work at all.
do you have any idea to do this ?
thanks in advance

example :

<div style="background-color: #142550;text-align: center;  mso-hide:all; ">
<div style="font-family: 'Montserrat', sans-serif;font-size:25px;font-weight: 700;text-align: center;text-transform: uppercase; color: rgba(156, 160, 163, 1);">
<p data-edit="GPtitle">Title</p>
</div>
<img align="center" data-edit="flag" height="90" src="https://******/images/image/2019/Flag/flag.jpg" alt="#" style="mso-hide:all;"/>
<div style="font-family: 'Montserrat', sans-serif;font-size:14px;font-weight: 700;text-align: center;text-transform: uppercase;  color: rgba(156, 160, 163, 1);mso-hide:all;">
<p data-edit="GPdate">Date</p>
</div>
<hr/></div>
<!--[if mso]>
<table width="100%" border="0" cellspacing="0" cellpadding="10" style="align:center; font-size:0;background-color: #142550; max-width: 960px">
  <tbody>
    <tr>
      <td style="font-family: 'Montserrat', sans-serif;font-size:25px;font-weight: 700;text-align: center;text-transform: uppercase; color: #9ca0a3;"><p data-edit="GPtitle">Title</p></td></tr>
		<tr><td style="text-align: center;"><img data-edit="flag" height="90" src="https://*******/images/image/2019/Flag/flag.jpg" /></td></tr>
		<tr><td style="font-family: 'Montserrat', sans-serif;font-size:14px;font-weight: 700;text-align: center;text-transform: uppercase;  color: #9ca0a3;"><p data-edit="GPdate">Date</p></td>
   </tr>
	
  </tbody>
		
</table>
<hr>
 <![endif]-->

@xleu The value of the data-edit attribute must be unqiue, but you have used the same values within the [if mso] section, GPdate and GPtitle.

hi duncanc,
yes, because the code behind <!–[if mso]> is suppose to replace the other one when the mail client is outlook, my issue is, if i put a data-edit attribute in the mso, it won’t be replaced, so i hope you’ve got a trick to help me :wink:
by the way, you can use the data-edit attribute twice or more (i’m sure you know that, you wrote it)

@xleu Ah I see now, I think. Everything between <!--[if mso]> and <![endif]--> is treated as a comment so passed unchanged.

Possibly add extra mso so that the elements with data-edit are outside of all mso, but the table structure elements are within mso.

1 Like

ok, so no trick, i will try to rewrite it… unfortunately…
outlook, gmail… pain in the ass
thanks :slight_smile: