title: Can I set the HTML dir attribute using CSS
body: <p>I am dealing with some Hebrew text that includes a few English words separated by commas. The HTML display is incorrect, and I am trying to see if it can be fixed with CSS or if I need to adjust the text with a direct HTML attribute.</p>
  <p>An example of how the text comes out natively:</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-css lang-css prettyprint-override"><code>.rtl {
    direction: rtl;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;body dir="rtl"&gt;
    &lt;h4&gt;Incorrect (no special styling)&lt;/h4&gt;
    &lt;p&gt;&lt;em&gt; ל-Space, Time ו-Energy&lt;/em&gt;&lt;/p&gt;
    &lt;h4&gt;Correct&lt;/h4&gt;
    &lt;p&gt;&lt;em&gt; ל-Space&lt;span dir="rtl"&gt;, Time&lt;/span&gt; ו-Energy&lt;/em&gt;&lt;/p&gt;
    &lt;h4&gt;CSS doesn't work&lt;/h4&gt;
    &lt;p&gt;&lt;em&gt; ל-Space&lt;span class="rtl"&gt;, Time&lt;/span&gt; ו-Energy&lt;/em&gt;&lt;/p&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Does anyone know if this can be accomplished with straight CSS?</p>
  <p>Thanks.</p>