title: CSS margin/padding is lost when copying/pasting from html page into MS-Word
body: <p>I have a web app with lots of text.<br>
  It uses indentation on most of its contents, which is important for the users who read it.</p>
  
  <p>For simplicity, let's say this is the code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div style="margin-left:40px;"&gt;
      &lt;div&gt;One&lt;/div&gt;
      &lt;div&gt;
          Two
          &lt;div style="margin-left:40px;"&gt;
              &lt;div&gt;i&lt;/div&gt;
              &lt;div&gt;ii&lt;/div&gt;
              &lt;div&gt;iii&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div&gt;
          Three
          &lt;div style="margin-left:40px;"&gt;
              &lt;div&gt;A&lt;/div&gt;
              &lt;div&gt;B&lt;/div&gt;
              &lt;div&gt;
                  C
                  &lt;div style="margin-left:40px;"&gt;
                      &lt;div&gt;x&lt;/div&gt;
                      &lt;div&gt;y&lt;/div&gt;
                      &lt;div&gt;z&lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div&gt;D&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div&gt;Four&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem is that whenever the user copy portions of it (or it entirely) and paste it into MS Word (docx) the indentation is lost. I need to find a way to keep the indentation for this case use.</p>
  
  <p><a href="https://i.stack.imgur.com/ebUIh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ebUIh.png" alt="enter image description here"></a></p>
  
  <p>I tried with margin and padding, the same thing happens.</p>
  
  <p>Any suggestions?</p>
  
  <p>The strange thing is that I tried with ul-li (and ol-li) instead of divs, and it works: the indentation is kept after pasting into Word. </p>
  
  <p>But I cannot use ul/ol because it automatically adds the bullets/numbers once pasted into the Word document, no matter what style I put from CSS (list-style-type:none).</p>