Superscript and Subscript (<sup>, <sub>)

1
2K

Superscript is used to display text above the baseline, while subscript is used to display text below the baseline. In HTML, these effects can be achieved using the <sup> and <sub> elements, respectively.

Superscript: <sup>

Example:

HTML
<p>H<sub>2</sub>O is the chemical formula for water.</p>
<p>2<sup>3</sup> equals 8.</p>

Subscript: <sub>

Example:

HTML
<p>H<sub>2</sub>O is the chemical formula for water.</p>
<p>2<sub>3</sub> is not a common mathematical notation.</p>

Note:

  • Both <sup> and <sub> are primarily used for presentation purposes and don't convey any specific semantic meaning.
  • They are often used for mathematical formulas, chemical notation, and other specialized content.

Additional Considerations:

  • You can combine superscript and subscript within the same element.
  • For more complex mathematical expressions, consider using LaTeX or specialized mathematical notation tools.

By using <sup> and <sub>, you can effectively display superscript and subscript text in your HTML documents, enhancing the readability and accuracy of content that requires these formatting elements.

Like
3
Search
Categories
Read More
Business
Steps to Write a Business Plan
A comprehensive business plan is a crucial tool for launching and growing a successful...
By Mpatswe Francis 2024-08-31 18:37:22 1 3K
Education
VLOOKUP FUNCTIONS
VLOOKUP is a powerful function in Excel that allows you to search for a value in a table and...
By Microsoft Excel 2024-09-23 20:04:52 0 3K
Technology
Decision Support Systems (DSS)
Decision Support Systems (DSS) are computerized information systems designed to assist in...
By Business Information Systems (BIS) Course 2024-08-01 17:00:08 0 3K
Computer Programming
Floating-Point Numbers and Arithmetic Expressions
Floating-point numbers A floating-point number is a number with a decimal. Ex: 3.14,...