The Custom CSS extension in Ultimate Blocks lets you add your own CSS to a single block, right in the block editor. Type selector in your CSS to target the current block only, so your changes never affect other blocks on the page. Custom CSS is free and works on every Ultimate Blocks block.
| Where to find it | Block sidebar, Styles tab (half-circle icon), Custom CSS panel at the bottom |
| Plan | Free |
| Works with | All Ultimate Blocks blocks |
| Best for | Small design changes that the block settings do not offer |
What you need #
- The free Ultimate Blocks plugin, installed and active.
- The Custom CSS extension turned on. It is on by default. You can check it under Ultimate Blocks in your WordPress admin menu, on the Extensions tab.
What you can use it for #
- Add a shadow, rounded corners or a custom border to one block.
- Change the style of an inner part of a block, such as its links, images or title.
- Change spacing or font size on small screens with a media query.
- Match a block to your brand when the built-in color and typography options are not enough.
How to add custom CSS to a block #
- Open the post or page in the WordPress block editor and click the Ultimate Blocks block you want to style.
- In the block sidebar, open the Styles tab (half-circle icon).
- Scroll to the bottom and click Custom CSS to expand the panel.

- The code field already contains
selector { }. Write your CSS rules between the curly brackets. - Mistakes are marked as you type. If a line has an error, such as a missing colon, semicolon or closing bracket, a red marker appears next to its line number. Point at the marker to see what is wrong, then fix the line before you save.
- The editor preview updates as you type. When you are happy, click Save or Update.

How the selector keyword works #
selector is a placeholder for the block you are editing. When the page loads, Ultimate Blocks replaces it with that block’s unique ID, so the CSS applies to this one block and nothing else. In the editor, it is replaced with the block’s editor wrapper so you can preview the result.
- Write
selectorin lowercase. The panel shows it as “Selector”, but only the lowercase word is replaced. - Use
selectoralone to style the whole block. - Add a space and another selector after it to style something inside the block, for example
selector imgorselector a. - You can use other CSS syntax too, such as media queries and hover states (
selector:hover).
Examples #
Add rounded corners and a soft shadow #
selector { border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }
Style the links inside the block #
selector a { color: #e11b4c; text-decoration: underline; }selector a:hover { text-decoration: none; }
Use smaller padding on phones #
@media (max-width: 767px) { selector { padding: 12px; font-size: 15px; } }
Find the class of an element inside a block #
To style one part of a block, you need its CSS class. Your browser can show it:
- Open the published page, right-click the part you want to change and choose Inspect.

- In the panel that opens, use the element picker (the arrow icon) and click the part again. The highlighted line shows its classes, for example
class="ub_review_item_name". - Back in the editor, target it inside the block:
selector .ub_review_item_name { font-weight: 700; }

Tip: let an AI assistant write the CSS #
If you do not write CSS, describe the change to an AI assistant such as ChatGPT or Claude. Include the class you found and ask it to start every rule with selector. For example: “Write CSS that makes selector .ub_review_item_name bold and red.”

Paste the result into the Custom CSS field and check the preview.

Good to know #
- Custom CSS is saved with the block. If you copy or duplicate the block, its CSS goes with it.
- The CSS is added to the page head for blocks in the post or page content.
- Because
selectorbecomes an ID, your rules usually win over the block’s own styles. If a rule still does not apply, add!importantto it. - For site-wide CSS that should affect every block of a type, use Appearance > Customize > Additional CSS or your theme’s style settings instead.
Frequently asked questions #
Is Custom CSS free in Ultimate Blocks?
Yes. The Custom CSS extension is included in the free Ultimate Blocks plugin and works on every Ultimate Blocks block.
What does selector mean in the Custom CSS field?
It stands for the current block. Ultimate Blocks replaces it with the block’s unique ID, so the CSS only affects that block.
Where is the Custom CSS option?
Select the block, open the Styles tab in the block sidebar and scroll to the Custom CSS panel at the bottom.
Why is my custom CSS not working?
Make sure you wrote selector in lowercase, that your CSS has no missing brackets, and that the Custom CSS extension is turned on. Clear your cache plugin if the editor preview works but the live page does not.
Can I use media queries?
Yes. Put selector inside the media query, for example @media (max-width: 767px) { selector { padding: 12px; } }.
How do I know if my CSS has a mistake?
Since version 3.7.0, the Custom CSS editor marks mistakes as you type. A red marker appears next to the line number of any line with an error. Point at it to see what is wrong.