Format superscript text in Divi

TIPS

Nov 21, 2020 | Divi Tips | 5 comments

Add the following CSS code to the Divi theme options area or your child theme style.css file.
[css]
sub, sup {
  font-size: 25%;
  /* Zero out the line-height so that it doesn't
     interfere with the positioning that follows */
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup {
  /* Move the superscripted text up */
  top: -1.25em;
}
sub {
  /* Move the subscripted text down, but only
     half as far down as the superscript moved up */
  bottom: -0.25em;
}
[/css]

5 Comments

  1. Hey, Thanks for this! Worked perfectly.

    Reply
    • Awesome! You’re welcome!

      Reply
  2. sub,
    sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    }
    sup {
    top: -0.5em;
    }
    sub {
    bottom: -0.25em;
    }

    Reply
  3. Hi sorry I’m new to all this CSS stuff, I’ve added this code to the DIVI Options but what else should I do please? Might you do a step by step guide please? lol I’d really appreciate before I lose the will to live…

    Reply
  4. Hi Mazz,
    There is nothing else to do, other than save the Divi options, unless you want to modify the CSS to suit your needs.

    Reply

Submit a Comment

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

More Tips

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

Cloudways Hosting

WPEngine Hosting

Pressable Hosting

AccuWeb Hosting

Ask the Divi Guy a Question

"*" indicates required fields