Math and Science Notations


Although HTML was first designed and used by scientists, it has yet to support mathematical and scientific notation with any degree of complexity. HTML does give you two tags to help write simple equations. Together with the codes for special characters, the <sub> (subscript) and <sup> (superscript) tags go a long way toward creating equations, as shown in Table 3.2.

Table 3.2. <sup> and <sub> Tags

You Type

The Browser Displays

A<sup>2</sup> + B<sup>2</sup> = C<sup>2</sup>

A2+ B2 = C2

CO<sub>2</sub> = Carbon Dioxide

CO2 = Carbon Dioxide


If you are looking to write more complex equations, you need to be a little more creative. The obvious answer is to write your equation in the program that you usually use, and then use a graphics program to turn it into an image. You can insert that image into any HTML page, as you've already learned. That works, but the solution is limited. Because the equation is graphical, you are not able to index or search for text within the equation. That's a big drawback, but so is the fact that images slow down your page's load time and the fact that your equation cannot be viewed by nongraphical Web browsers.

Tip

Some commercial products are available to help you notate mathematical expressions. You can see a list of them on the W3C Web site (www.w3.org/Math/).




Sams Teach Yourself HTML in 10 Minutes
Sams Teach Yourself HTML in 10 Minutes (4th Edition)
ISBN: 067232878X
EAN: 2147483647
Year: 2004
Pages: 151
Authors: Deidre Hayes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net