How to add CSS to my page or website: 3 methods

There are several ways to add custom CSS to a WordPress site, depending on your needs and level of control.

1. Using the WordPress Additional CSS Customizer

The easiest way to add CSS is through the WordPress Customizer. From your dashboard, go to Appearance → Customize → Additional CSS. A text area will open where you can type or paste your CSS code. As you add styles, you’ll see a live preview of the changes before publishing.

WP Additional CSS

2. Using an HTML block (in the block editor)

If you want to style a specific page or section, you can use an HTML block within the Gutenberg editor. Add an HTML block, wrap your content with <style> tags, and include your CSS code. For example:

<style>
h2 { color: #0073aa; }
</style>

This method applies styles only to that page or post.

3. Using a Child Theme

For advanced customization, create a child theme and add your CSS to its style.css file. This gives you full control and ensures your changes persist after theme updates. It’s the preferred approach for developers or larger design changes. Official WordPress documentation on child themes.