In consideration of machine based readability (but not exclusively, please advice where relevant), is it better to use
square²
or
square<sup>2</sup>
in my HTML file (using utf-8 encoding)?
I suggest to use <sup>
tag in html context.
Full official answer can be found here: Superscripts and Subscripts
First reason:
When used in mathematical context (MathML) it is recommended to consistently use style markup for superscripts and subscripts. This is because mathematical layout allows not just individual symbols, but entire expressions to be superscripted or subscripted in a regular, nested manner.
Second reason:
However, when super and sub-scripts are to reflect semantic distinctions, it is easier to work with these meanings encoded in text rather than markup, for example, in phonetic or phonemic transcription. Otherwise, they would require markup in the middle of words, and they may also be inadvertently changed to normal style text, when exporting to plain text. This applies to the majority of super and subscripted characters in Unicode. On the other hand, some user agent may support certain superscripted or subscripted characters only when used as marked up text for example, because of lack of font support for them.
I prefer to use the UTF-8 symbol, because the <sup>
tag actually changes the line height slightly, a very annoying undesirable side effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With