- Paragraphs
- Text Emphasis
- Headings
- Special Characters
- Math and Science Notations
- English Isn't the Only Language
- Meta Tags
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 (http://www.w3.org/Math/).