title_body: When it is better to use plain HTML instead of CSS? I published a book which contains some (simple) math formulas, like axn+bxn&minus;1+ … + hx + k = 0. Such formulas may be displayed just with (X)HTML, as you may see. However, some friends of mine complained that on their Kindle the formulas were misformatted, and the exponent was at the same level of the text, like axn+bxn&minus;1+ … + hx + k = 0. I checked the content of the ebook, and I found this snippet:
  
  &lt;span class="corsivo"&gt;ax&lt;/span&gt;&lt;span class="apicecorsivo"&gt;n&lt;/span&gt; + 
  &lt;span class="corsivo"&gt;bx&lt;/span&gt;&lt;span class="apicecorsivo"&gt;n&lt;/span&gt;&lt;sup&gt;-1&lt;/sup&gt; 
  + … + &lt;span class="corsivo"&gt;hx&lt;/span&gt; + &lt;span class="corsivo"&gt;k&lt;/span&gt; = 0
  
  
  ("corsivo" means italics in Italian and "apice" superscript, in case you wondered why the names of the classes). 
  
  My question is: for better compatibility among browsers, is it better to create a lot of CSS styles and to add spans in the text, or to stick to (ugly) XHTML primitives?
upvoted_answer: In general, formatting with HTML (though regarded as outdated by many, including W3C) tends to work more reliably than formatting with CSS. Support to CSS varies and can be disabled (though this is rare and mainly applies to web browsers). However, HTML formatting is very limited. You can use &lt;i&gt; for italic, &lt;sup&gt; for superscript, and a little else, but you cannot e.g. specify the size or vertical position of superscripts (which depend on user agent and vary considerably).
  
  In e-books, however, we can expect CSS work well for the simple formatting that would be possible in CSS, too. I tested your example, with an ebook created with Sigil and then converted to .mobi format with Calibre, and viewed with Kindle for PC, the exponents worked OK, the same way with HTML only, when I used the obvious CSS rules
  
  .corsivo { font-style: italic }
  .apicecorsivo { font-style: italic; vertical-align: super; font-size: 80% }
  
  
  So if the exponents didn’t work, probably either the e-book is missing a CSS rule that makes .apicecorsivo appear as a superscript, or that rule was somehow lost when generating the .mobi version.
  
  For stylistic reasons, it is best to avoid mixing HTML and CSS formatting so that e.g. some exponents are marked with &lt;sup&gt;, some just styled with CSS (set on &lt;span&gt; elements for example). The reason is that generally you cannot guarantee that the style applied is really the same. Your example has &lt;span class="apicecorsivo"&gt;n&lt;/span&gt;&lt;sup&gt;-1&lt;/sup&gt;, which is meant to produce “n−1” as superscript, but it may happen that they will be differently subscripted, i.e. in different font size or in different vertical position.
  
  There are considerable styling problems with &lt;sup&gt; in web browsers; they tend to produce uneven line spacing as well as qualitatively questionable superscripts. Such issues might not be that relevant in e-book readers, but it might still be safest to use a combined strategy, using &lt;i&gt; for italic (it’s rather safe) but CSS for superscripting. This would mean, in the example case, HTML markup like
  
  &lt;i&gt;a&lt;/i&gt;&lt;i&gt;x&lt;/i&gt;&lt;span class="sup sgc-2"&gt;n&lt;/span&gt; + 
  &lt;i&gt;b&lt;/i&gt;&lt;i&gt;x&lt;/i&gt;&lt;span class="sup"&gt;&lt;i&gt;n&lt;/i&gt; &amp;minus; 1&lt;/span&gt; + … +
  &lt;i&gt;h&lt;/i&gt;&lt;i&gt;x&lt;/i&gt; + &lt;i&gt;k&lt;/i&gt; = 0
  
  
  with CSS like
  
  .sup { position: relative; bottom: 1.8ex; font-size: 80% }