All Collections
Divi Documentation
Customizing Divi
How to add Text Underline effect with CSS in Divi
How to add Text Underline effect with CSS in Divi

This article will help to add text Underlines in Divi.

Rijendra avatar
Written by Rijendra
Updated over a week ago

This tutorial will help you add some cool Text underlines with a few lines of CSS

The default Rich Text editor settings do have simple Underline options for texts:

However, sometimes you might want to have a different color, more stylish and cool underlines to make it more attractive. You can see below the steps to achieve that:

  1. Add sample content to the Text module

  2. Add a <span> HTML tag and the custom class: et_underline_text to the text that you want to underline.


    For example, this is the sample text that I want to underline, so this will be the code:

    <span class="et_underline_text">Sample Content</span>

    You will need to switch to "Text" mode to add those <span> tags to the content.

  3. Adding the CSS code for the underline effect.

    Go to WordPress Dashboard > Divi > Theme Options > Custom CSS and add this CSS there:
    โ€‹

    .et_underline_text {
    box-shadow: inset 0 -0.5em 0 #9fe8c3;
    text-decoration: none;
    }


    After adding the CSS, save your Theme Options, and check the result on the front end. You should see some cool text underline effects on the text.
    โ€‹
    You can change the color code #9fe8c3 to any other color of your choice.

Did this answer your question?