CSS !important declaration not working in Outlook 2007

南笙酒味 提交于 2020-02-03 13:17:44

问题


I want to create an email template with anchor color red, it should be with !important declaration to avoid inheriting other style values.

Unfortunately it is not render properly in Outlook 2007/2010... Any one have similar experience? Issue related to !important tag support in Outlook.

I have listed my code here, Please have look.

<body><table width="500" border="1" cellspacing="5" cellpadding="5">
  <tbody>
    <tr>
      <td>Lorem Ipsum is simply dummy text into <a href="#">electronic</a> typesetting, and more recently with <a href="#" style="color:#F30408 !important;">desktop</a> publishing software like Aldus PageMaker including versions of Lorem Ipsum.</td>
    </tr>
  </tbody>
</table>
</body>

回答1:


I tried this and it worked for me in Outlook 2007. Outlook sometime failed to execute the css inside style even if we give !important. So try to use this way, it will work in Outlook and gmail also.

<table width="500" border="1" cellspacing="5" cellpadding="5">
  <tbody>
    <tr>
      <td>Lorem Ipsum is simply dummy text into <a href="#">electronic</a> typesetting, and more recently with <a href="#"><font color="#F30408">desktop</font></a> publishing software like Aldus PageMaker including versions of Lorem Ipsum.</td>
    </tr>
  </tbody>
</table>



回答2:


I have tried the following code:

<p><a href='#' style='color: #F30408'>desktop</a></p>
<p><a href='#' style='color: #F30408 !important'>desktop</a></p>
<p><a href='#'><font color='#F30408'>desktop</a></p>

You can see the results here:

So basically, !important doesn't work in Outlook 2010 it seems.



来源:https://stackoverflow.com/questions/31934741/css-important-declaration-not-working-in-outlook-2007

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!