0

I have some problems with Outlook on Windows 10 (I don't know for the older ones). I am aware of the CSS compatibility problems on newsletters but I am not making any progress.

My inline styles work. The ones in class too. But not those with a succession of classes or tags.

Example :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>{{title}}</title>
    <style type="text/css">
      /* WORKS */
      .title {
        color: green;
      }

      /* DOESN'T WORK */
      .news .title {
        color: red;
      }
    </style>
  </head>

  <body>
  <table>
    <tbody>
      <tr class="news">
        <td class="title">
          My title.
        </td>
      </tr>
    <tbody>
  </table>
</html>
TGO
  • 216
  • 3
  • 8
  • Possible duplicate of [CSS Styling won't work in outlook 2010?](https://stackoverflow.com/questions/8310609/css-styling-wont-work-in-outlook-2010) – Bronzdragon Oct 30 '18 at 15:12
  • Found this Looks like what your'e looking for. https://stackoverflow.com/questions/17623120/outlook-com-how-to-target-css-at-a-specific-class – stephendeo Oct 30 '18 at 15:14

1 Answers1

0

Unfortunately, CSS support in emails is very limited so you have to add the attributes you want in another class or inline in the tag directly.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>{{title}}</title>
    <style type="text/css">
      .title {
        color: green;
      }

      .news-title {
        color: red;
      }
    </style>
  </head>

  <body>
  <table>
    <tbody>
      <tr class="news">
        <td class="news-title">
          My title.
        </td>
      </tr>
    <tbody>
  </table>
</html>
SystemGlitch
  • 2,150
  • 12
  • 27
  • It is a partial solution but it does not completely meet my needs unfortunately. Because the goal is to be able to apply a style to all the titles of a section for example. – TGO Oct 30 '18 at 15:26
  • I'm afraid you'll need to apply a specific class for each of your titles. – SystemGlitch Oct 30 '18 at 15:28