Skip to main content
How to Increase the Height of Divi's Custom CSS Box

Learn how to increase the height of Divi's custom CSS box for a more comfortable and efficient coding experience.

Updated over a week ago

Working with custom CSS in Divi can sometimes be challenging due to the limited height of the CSS input box, making editing more difficult.

Increasing the height of the custom CSS box allows for a more comfortable and efficient coding experience by providing more visible lines of code at once.

This article will guide you through the steps to increase the height of Divi's custom CSS box, enhancing your ability to write and manage your custom styles effectively.

Increase the height of Divi's Custom CSS box using a Child theme

  1. Install and activate a Divi Child theme

  2. Go to WordPress Dashboard β†’ Appearance β†’ Theme Files Editor

  3. Open the functions.php file and add this PHP code after the existing code

     function divi_admin_custom_css() {
    echo '<style id="divi-increase-css-box-height">
    #divi_custom_css + .CodeMirror-wrap{
    height: 800px !important;
    resize: both;
    overflow: auto;
    }
    </style>';
    }
    add_action( 'admin_head', 'divi_admin_custom_css' );

  4. Save your changes

Increase the height of Divi's Custom CSS box without a Child theme

  1. Install and activate the Code Snippets plugin

  2. Create a new PHP snippet and add this PHP code

    function divi_admin_custom_css() {
    echo '<style id="divi-increase-css-box-height">
    #divi_custom_css + .CodeMirror-wrap{
    height: 800px !important;
    resize: both;
    overflow: auto;
    }
    </style>';
    }
    add_action( 'admin_head', 'divi_admin_custom_css' );

  3. Check the option called Only run in the administration area

  4. Save your changes

Note: You can adjust the 800px value to any other value of your choice(depending on if you want to make it smaller or bigger)

The result can be seen in the screenshot below:

Increase the height of Divi's Custom CSS box
Did this answer your question?