Bootstrap Utilities: 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

Source: Jakobus Benjamin, Marah Jason (2018), Mastering Bootstrap 4: Master the latest version of Bootstrap 4 to build highly customized responsive web apps, Packt Publishing; 2nd Revised edition.

Leave a Reply

Your email address will not be published. Required fields are marked *