In This Article
Introduction
WordPress 7.0 introduced the ability to apply custom cascading style sheets (CSS) to individual blocks in the editor. I searched for, tested, and played with some snippets of CSS code (styles). Here they are for you to copy and adapt.
This post has several goals: 1) show some cool styles and design techniques, 2) show how CSS styles are findable online, and 3) have some fun with CSS in WordPress.
This is Intermediate Level Editing, Maybe Advanced
This is intermediate editing, not beginner level. WordPress has some easy, point-and-click styling, but this isn’t that. With this tip, you easily navigate to the new Additional CSS field, but once there, you use code. So be ready for that.
It helps to understand at least a little about CSS, though often you can simply copy and paste code. See the helpful links below to learn about CSS.
You also need to edit a block’s Additional CSS under Advanced. See the link below to learn about the Advanced settings.
Helpful Links
Learn about CSS: W3 Schools CSS Tutorial
Learn about the WordPress Block, Additional CSS: Advanced Settings overview, Additional CSS
Even if you don’t know much about CSS, the examples below have the CSS you can copy and paste onto your site to see how it looks.
CSS is Safe Code, But Test Thoroughly
As code goes, CSS is safe because it’s not executable. It’s a style language. It won’t erase data or files, but it could momentary make things look bad. If something doesn’t look right, just delete the Additional CSS. That should clear it up.
Of course, always test any of these when you use them, ideally on a staging site, not a live site. Make sure they look right on the front end and small screens.
With that, here are some examples you can copy and adapt.
Let’s play.
CSS Examples You Can Copy and Play With
Fancy Shapes with CSS Radius
The CSS property border-radius is more than rounded corners. It can shape blocks like in these examples. See the helpful links below to learn more about border-radius.

Here’s a Cover block with these radius settings in Additional CSS.
border-top-left-radius: 100% 50px;
border-bottom-right-radius: 100% 50px;Here’s a Stack block with this Additional CSS.
border-radius: 10% / 50%;
width: 300px;
height: auto;Here’s a Stack block with this Additional CSS.
border-radius: 10px 100px / 120px;
width: 300px;
min-height: 350px;Here’s a Stack block with this Additional CSS.
border-radius:35% 35% 0% 0% / 100% 100% 0% 0%;
width: 350px;
min-height: 300px;Helpful Links
Learn about CSS border-radius: MDN border-radius CSS property
Play with Fancy Shapes with Point-and-Click Ease: Fancy Border Radius Generator
(This is a very cool tool to try different border radius settings.)
Some Backgrounds from CSS-Tricks.com
CSS-Tricks.com is a fantastic site for, you know, CSS tricks. I’ve learned a lot there over the years. Anybody interested in learning CSS should surf the site for tips, tricks, and design. It’s a great resource.
These background examples are adapted from The Greatest CSS-Tricks – Volume I at CSS Tricks. At this online “book”, you’ll find 15 chapters with lots of examples including copyable code.
This is a Group block with Additional CSS adapted from CSS-Tricks.com to create the background:
{ background-image: radial-gradient(#b1dcff 20%, transparent 20%), radial-gradient(#d6ecff 20%, transparent 20%);
background-color: #d1e6f6;
background-position: top left, 50px 50px;
background-size: 100px 100px;
}This is a Group block with this Additional CSS:
&::before {
background-color: #cfd8dc;
background-image: repeating-linear-gradient(
45deg,
transparent,
transparent 1px,
#90a4ae 1px,
#90a4ae 2px
);
content: "";
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
filter: blur(2px) opacity(.2);
}This is a Group block with the same CSS as the previous example, but the WordPress point-and-click editor is used to edit these settings:
- Background color: HEX #DEEFFDC7 (a semi-transparent light blue)
- Border Radius: 30px.
Changing the background color to a transparent color in WordPress colorizes the background that’s in Additional CSS.
Vertically Align/Center Images in a Grid
I wanted to vertically center logos in a Grid block, but vertical alignment isn’t available for the block. Here’s the CSS to paste in the block’s Additional CSS:
& > *
{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}Here’s a Grid block of logos vertically centered with this CSS.







Get CSS Code from AI
Of course, AI can write CSS code. Here are a few results from ChatGPT.
Checkerboard Background
I asked ChatGPT for a CSS background with this prompt: “pure css code for a background of a solid color with diamonds step and repeat”. It answered with this code. It’s not exactly what I was going for, but it’s usable:
background-color: #2f6fed;
background-image:
linear-gradient(45deg, rgba(255,255,255,.12) 25%, transparent 25%),
linear-gradient(-45deg, rgba(255,255,255,.12) 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, rgba(255,255,255,.12) 75%),
linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.12) 75%);
background-size: 40px 40px;
background-position: 0 0, 0 20px, 20px -20px, -20px 0px;Here is a Cover block with that Additional CSS. This paragraph has a semi-transparent white background so this text is more readable on this background.
ChatGPT provided this additional information:
This gives you a solid-color background with a repeating diamond/checker pattern, using only CSS.
For a more subtle pattern, reduce the
rgbaalpha:rgba(255, 255, 255, 0.06)Or change
#2f6fedto whatever base color you want.
Here’s an example with a lighter background, which is edited on the first line of the code.
Here is a Cover block with the same custom CSS except the background color on the first line is “#d6e0f6”, which is a lighter color. This paragraph does not have a background because it isn’t needed.
Change Text Color Based on the Vertical Position in a Container
Here’s the ChatGPT prompt I used: “pure css to change color of text based on vertical position in the parent container”
Here’s the CSS it provided.
background: linear-gradient( to bottom,
red 0%,
purple 50%,
blue 100%
);
background-clip: text;
-webkit-background-clip: text;
color: transparent;Here’s an example of this CSS in a Group block.
This box (Group block) contains text on a white background. The custom CSS makes the text at the top red. It makes text at the bottom blue.
Text in between changes from the first color to the last, so in this example, text is purple in the middle.
Here’s another line. The next two paragraphs are filler text just to show this example.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
This is the last line, and it’s blue.
A Warning for Beginners: Limit how often you use Additional CSS.
Good and proper web design includes site-wide CSS, which lets you change a style in one place and apply it site wide. Using Additional CSS on lots of individual blocks means you’ll have to find and change each instance when you want to update them. So be careful about how many times you use it.
WordPress has other ways to change site-wide styles. If you find your self repeating per-block Additional CSS, look into other ways of applying those styles. This blog post can’t cover all of that.
If you’re a beginner, I suggest you also learn about WordPress block themes, full-site editing, the style book, block styles in full-site editing, and synced patterns. These are useful for managing site-wide and repeated styles and content.
For now, remember that lots of instances of Additional CSS for blocks makes updating design much more difficult.
Conclusion: Additional CSS for Blocks is a Fun and Useful Update
You can find lots of CSS to copy and paste into the new WordPress feature Addition CSS for blocks. You can also create your own and edit anything you find online. It’s a handy update to styling content. If you like graphic design and web design, it can be fun, too.
Whether you copy CSS you find online or make your own, it can be useful and downright fun to play with it.



