Adding custom CSS to an element gives web creators almost unlimited flexibility in designing their web pages.
Add custom CSS
To add custom CSS to an element:
- Click the Style tab. (Note: If you are using the Atomic Editor, Custom CSS may also be located under the Advanced or CSS settings depending on the element.)

- Open the Custom CSS field.

- The CSS editor opens.

- Add the CSS code.

CSS code is added to the selected class, so you can have separate CSS code for different classes and states. In the example below, we’ll use custom CSS to change the default text color and the hover text color.
- Add a Heading widget to the canvas.

- Click the Style tab.
- Open the Custom CSS field.
- In the CSS editor enter the following:
color:red;
The heading text turns red.
- In the Classes text box click the ellipses and select hover.

- Open the Custom CSS field.
- In the CSS editor enter the following:
color:blue
Now the text is red, but when you hover over it, it turns blue.
Since Custom CSS applies to device sizes as well as states, you can change the text color according to device size. - Click the Local class.

- Click the mobile icon.

- Open the Custom CSS field.
- In the CSS editor enter the following:
color:green
The heading text turns green for mobile devices.
Using a CSS media query
A media query allows you to apply styles based on the characteristics of the user’s device, such as its screen width, height, resolution, or orientation.
Although custom CSS generally applies to a specific screen size, you can use media queries to add responsively. For example, the CSS below can be added to the desktop CSS code and will turn the font red for any device under 600px:
Advanced Editor Features & Security (v4.4+)
Elementor 4.4 introduces a more powerful and flexible CSS editing experience. Whether you are writing styles for a single element or using Global Custom CSS, the following features and rules apply:
Modern CSS Support
The editor now fully supports modern CSS syntax, allowing you to use advanced techniques without external stylesheets:
- CSS Nesting: Write cleaner code by nesting child selectors inside parent rules.
- Container Queries: Create truly responsive designs that react to the size of the element’s container rather than the entire viewport.
- Custom Properties: Full support for defining and using CSS Variables (e.g.,
--my-color: #fff;).
Intelligent Editing
- Autocomplete: As you type, the editor provides real-time suggestions for CSS properties, values, and selectors to speed up your workflow.
- Smart Paste: When you paste code from external sources, the editor automatically detects and preserves the correct formatting.
Code Validation & Security
- Advisory Linting: The built-in code linter is now advisory rather than blocking. While it will still highlight potential syntax errors or “unknown” properties with a warning icon in the gutter, it will no longer prevent you from saving your changes. This allows you to use cutting-edge CSS features that the linter might not yet recognize.
- Security Restrictions: For your site’s safety, security restrictions still apply. The editor will continue to block unsafe or non-CSS patterns (such as
<script>tags or malicious injections) while allowing all valid CSS structures.