Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Displaying a square root with HTML

DZone's Guide to

Displaying a square root with HTML

· Web Dev Zone
Free Resource

Get the senior executive’s handbook of important trends, tips, and strategies to compete and win in the digital economy.

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

    <math><msqrt><mi>2</mi></msqrt></math>
is displayed as
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.

Related reading:

 

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

Read this guide to learn everything you need to know about RPA, and how it can help you manage and automate your processes.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}