Change the Superscript Font Size in Divi Modules

Written by Dan Mossop

By default, Divi displays superscripts in modules such as the text module at the same font size as the surrounding text. To improve readability and maintain typographical hierarchy, it’s often preferable to have superscripts appear smaller than the rest of the text within a module.

For those of you looking to customize the appearance of superscripts, this post explains how to do it.

To change the superscript font size in Divi modules:

  1. Navigate to "Divi > Theme Options > General > Custom CSS".
  2. Insert CSS to set the superscript font size to 75% of the base font size and correct its vertical position.
  3. Adjust the font size percentage and position values to suit your site design.

Change the Divi Superscript Font Size with CSS

The following CSS code sets the font size of <sup> elements in a list of common modules to 75% of the default size and adjusts their vertical position:

.et_pb_text sup,       /* Text Module */
.et_pb_blurb sup,      /* Blurb Module */
.et_pb_slider sup,     /* Slider Module */
.et_pb_testimonial sup,  /* Testimonial Module */
.et_pb_accordion_item sup,   /* Accordion Module */
.et_pb_toggle sup,       /* Toggle Module */
.et_pb_cta sup   /* Call to Action Module */ 
{
    font-size: 75%; /* adjust as needed */
    bottom: 1em; /* increase to raise the superscript - the default value is 0.8em */
}

This CSS doesn't just adjust the size but also the vertical alignment of the superscript text within specific Divi modules – namely Text, Blurb, Slider, Testimonial, Accordion, Toggle, and Call to Action modules.

By default, Divi sets the bottom property to 0.8em. Using em units allows this property to scale accordingly when the main text font size changes (since normally the superscript takes the font-size of the surrounding text). But when the font size of the superscript is reduced, the bottom property which is relative to it will also reduce, shifting the superscript down. The 1em value used here corrects for this, keeping the superscript higher up. 

To implement this customization, simply put the above code in the "Divi > Theme Options > General > Custom CSS" box.

You’re free to adjust both the font-size and bottom values to match the design of your site.

Unlock the Full Potential of Shortcodes in Divi!

Empower your Divi site with the Divi Shortcode Enabler. This plugin allows shortcodes to run effortlessly in various Divi module fields, enhancing functionality and customization across your site.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

2 Comments

  1. This works great, except when making it smaller, it moves the superscript down towards the bottom of the text. How can we keep it aligned to the top?

    Reply
    • Hi Janelle

      The "bottom" property is the key here — it defines the element's vertical alignment relative to the text baseline. In Divi, the default is 0.8em, which being in "em" units makes it dependent on the font-size – when we decrease the font-size, the bottom value decreases too, moving the subscripted text down. To counter this, you can adjust the "bottom" property value accordingly, e.g.:

      .et_pb_text sup,       /* Text Module */
      .et_pb_blurb sup,      /* Blurb Module */
      /*... other modules ... */
      {
          font-size: 75%;  /* Modify to adjust the size of the superscript text */
          bottom: 1em;  /* Increase this value to shift the superscript up */
      }
      

      With this CSS, the "bottom" value compensates for the change in font size, maintaining the top alignment of your superscript.

      I hope that helps,
      Dan

      Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

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

We may earn a commission when you visit links on our website.

Latest Posts

Set Custom CSS IDs for Individual Divi Accordion Items

Assigning unique CSS IDs to specific Divi Accordion items allows for precise control over styling, targeting, and linking within your page content. This ability is particularly useful when you want to apply custom designs or create anchor links to particular accordion...

Enable Swipe Navigation in the Divi Gallery Lightbox

Enabling swipe navigation in the Divi Gallery module's lightbox allows users to seamlessly browse through gallery images by swiping left or right, creating a more interactive and mobile-friendly experience. This functionality can significantly improve user engagement...

Disable Slide-In Animation for Divi Gallery Grid Images

Control how images appear in your Divi Gallery module by toggling the slide-in animation effect for grid layouts. Disabling the slide-in animation allows gallery images to load instantly and appear statically, providing a faster and distraction-free browsing...

Control Image Count Display in Divi Gallery Lightbox

Displaying or hiding the image count in the Divi Gallery module’s lightbox can help customize the user experience, depending on whether you want to give visitors an indication of gallery progress or prefer a cleaner, distraction-free view. The ability to toggle this...

Hide Gallery Image Titles in the Divi Lightbox Overlay

Displaying image titles in the lightbox overlay of the Divi Gallery module can sometimes be distracting or unnecessary, depending on your website’s design and user experience goals. Hiding these titles creates a cleaner and more focused viewing experience for visitors...

Random Posts