Bootstrap 4 – Sub and sup

The sub and sup elements can be used to create subcript and superscript text respectively. Bootstrap styles these elements, such that the following actions are performed:

  • The position is relative.
  • The font-size is slightly reduced (to 75%).
  • The line height is 0.
  • The vertical-alignment property is set to baseline.

Furthermore, sub has the value of its bottom property set to -.25em, forcing the element to appear slightly further down. Similarly, sup is forced toward the top by having its top property set to -.5em:

 Lorem <sub>ipsum</sub> dolor sit <sup>amet</sup>, consectetur adipiscing elit
Figure 8.16: Using the sub and sup tags to create subscript and superscript text

Comments are closed.