Over a million developers have joined DZone.

Displaying a square root with HTML

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

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
Not all browsers display the above equally well, but it is always readable.

MathML for newer browsers. The following HTML source

is displayed as
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.

Related reading:


From http://www.2ality.com/2011/10/html-square-root.html

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}