## 2011-10-04

### Displaying a square root with HTML

This post shows two ways of displaying a square root with HTML.

Pure HTML for older browsers. The following HTML source

    &radic;<span style="text-decoration: overline">2</span>

is displayed as
2
Not all browsers display the above equally well, but it is always readable.

MathML for newer browsers. The following HTML source

    $<msqrt><mi>2</mi></msqrt>$

is displayed as
$\sqrt{2}$
With MathML being part of HTML5, all modern browsers support MathML. Which is a god-given for those of us who remember the HTML documents that were generated from LaTeX source files by converting formulae to bitmap graphics.