Sending emails to Microsoft teams channel does not keep css format

Viewed 792

I set up a channel where I sent an email with a specific css. In outlook I can see the message perfectly, but the channel does not display any colour. I even added the css with classes and id tags into the html file, but it does not work.

Example: The message is something like:

<html>
   <head>
    <script src= 'https://statics.teams.cdn.office.net/sdk/v1.6.0/js/MicrosoftTeams.min.js'></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    #first{ color: orange; }
    #secondLine {
      background-color: lightblue;
      color: red;
    }
    .override {color: green;}
    </style>
   </head>
   <body>
      <script>
    microsoftTeams.initialize();
      </script>
      <p class="override">Hi there,</p>
      <p id="first"> First line:test.</p>
      <p id="secondLine">Second line Another test.</p>
      <p style="color:blue">Best Regards.</p>
   </body>
</html>

In outlook:

enter image description here

In Microsoft Teams channel:

enter image description here

I think that maybe it can not display the colour due to a css conflict with Microsoft teams css. If it is the case, could I override it?

Thank you in advance.

1 Answers

Due to the need to make sure Teams theming and other display constraint in channel works with content mailed into channel, we do not promise to preserve arbitrary HTML / CSS structure inside the email. If complex format is needed in the post, we usually ask users to author them directly in Teams instead of relying on our email to channel logic to preserve them.

We already try to preserve as much formatting as possible without affecting the overall Teams themes. This is by design.

Related