All Collections
Divi Documentation
Customizing Divi
CSS Error Expected Brace, Unexpected Token
CSS Error Expected Brace, Unexpected Token

Errors in Custom CSS Box

Andrei N avatar
Written by Andrei N
Updated over a week ago

This type of error can appear in Divi > Theme Options > Custom CSS box, in the Advanced settings of the modules/row/settings, Child theme style.css file or in any other places where you add custom CSS, if the CSS code has incorrect syntax. Usually, the error appears if the closing brace is missing.

This is one of the common causes of having broken layouts/missing styles in Divi Pages.

The correct CSS rule should look like this:

selector {
property_name: property_value;
}

If you see the error you will need to make sure that all CSS rules have opening and closing braces, here is an example:
โ€‹

In case you are using @media query make sure that all opening braces have closing braces. Here is an example of a valid @media CSS code:

@media (max-width: 980px) { 

selector {
property_name: property_value;
}

}

In the Advanced settings of the modules you can add only CSS properties, the CSS selector will be added automatically on the front end. Clicking on the help icon will show which selector will be used. Correct CSS syntax in this case will be

property_name: property_value;

Here is an example:

Did this answer your question?