Add Custom CSS Code

Home » Knowledge Base » Design Tools » WordPress » Add Custom CSS Code

Adding custom CSS code to your WordPress site is a great way to personalize and tweak your site’s design beyond the options provided by your theme. You can add custom CSS code to your WordPress theme, via the customization options or directly in the styles.css file, editable through the theme editor.

 

What is CSS

CSS, which stands for Cascading Style Sheets, is a coding language designed primarily for styling websites. It allows you to modify the appearance, color, and positioning of various elements across your site.

The term “cascading” in its name highlights a key feature: if multiple styles are applied to the same element, the style located lower in the stylesheet will prevail, reflecting the most recent modification made to that element.

Learning CSS can significantly enhance your web development skills, even if you’re using WordPress, which is known for its user-friendly content management system. A great starting point for mastering this programming language is the CSS course offered by W3Schools.

 

How to add Custom CSS to WordPress

It is really easy to add additional CSS to your WordPress website.  There are two main methods to do so. Each of them, of course, has its positive and negative sides, as they are adding the code in different places on your website. As mentioned above, we’ll cover how to add custom CSS code through the theme customizing page. The main reason for that is the fact, that it is easier to add code there, as it won’t be removed once your theme gets updated. As we’ve already discussed, it is recommended that you choose a theme that is getting regular updates.

Also, using this method, even if you change the theme, the changes will remain. It is another question of how much of them will apply to the new theme, as it will probably use different CSS classes for the same site elements. Still, the important fact is that the code you’ve written, shouldn’t get lost with updates, etc.

If you want to write your code directly in the styles.css file of the theme, it is recommended that you create a Child theme.

 

Adding Custom CSS with the WordPress Customizer

With the integrated personalizing feature offered by WordPress, you can do a lot more than adding custom CSS. Yet, we will focus on doing that. As we’ve covered it before, you can read more about the capabilities of WordPress Customizer. Here is how to add custom CSS through the WordPress Theme Customizer.

 

Step 1: Access the WordPress Customizer

To access the WordPress customizer, log in to your WordPress website.  Once you are in the Dashboard, navigate yourself toward the “Appearance” menu in the sidebar. Hover over it and in the submenu that will show up, select “Customize.” Doing so will open the WordPress Customizer.

 

Step 2: Find the Additional CSS Section

All of the WordPress themes have some of the options in the Customizer. Specifically “Site Identity”, “Widgets”, “Menus”, and, of course, “Additional CSS”. Therefore, depending on the theme you are using, the option you will need to add Custom CSS code might be easier to find.

In the Customizer, scroll through the sidebar options until you locate the “Additional CSS” section. This will open a new page where you can add your custom CSS code.

Step 3: Enter Your Custom CSS

Once the “Additional CSS” box loads up, you can start typing or pasting your CSS code. If you know how to write CSS, most probably you know how to find the class you need to alter. Unlike the theme editor option, using the Additional CSS one, through the WordPress customizer, will let you see the effect of your changes live. So, you will know if something is wrong before publishing the changes.

 

Step 4: Publish Your Changes

Once you are happy with the changes you’ve made, click the “Publish” button on the top right corner of the sidebar menu. Doing so will apply the custom CSS across your entire website. The changes will be visible for all the users.

 

Further Recommendations:

Here are some recommendations for your first changes in the CSS.

Keep the Changes to a Minimal Level

It is best, especially if you are still learning, to keep the changes to a minimal level. They should be considered and targeted. That will ensure ease of management and troubleshooting.

 

Use Comments

Code comments are used so that the developers can easily orient themselves to the purpose of a specific code chunk. Adding comments in CSS will let you easily understand what changes you’ve made and why. Although, while writing the first lines it might not look necessary with time the code will accumulate, and therefore, the complexity of the changes. That might make it difficult for you to find a specific change that you’ve made (or whether you made it at all).

 

Use Backups

Before any significant change on a website, the best practice is to create a backup. Don’t underestimate the value of a backup. Sometimes it is better to be safe than sorry.

 

If you need more in-depth directions, check our previously published article on How to Add Additional CSS to WordPress and Further Customize Your Website

If you feel like you are ready to go further in the CMS, feel free to browse our WordPress Tutorials section.

Was this post helpful?

i

Relevant tags:

Connect

Latest posts:

How to Find Modules in MediaWiki

After you install MediaWiki, log in to the CMS, and presumably install extensions, it is time to learn how to find modules in MediaWiki.   What are MediaWiki Modules Modules in MediaWiki are Lua-based scripts that allow you to add various functionalities to your...

How to Fix MediaWiki Internal Error: A Step-By-Step Guide

MediaWiki Internal Error message can be very frustrating and can significantly harm your MediaWiki project. Luckily, the issue can be fixed in a few easy-to-follow steps to get your website up and running in no time. There are various causes for the issue: Incorrect...

How to Add Infobox Module in MediaWiki

The Infobox in MediaWiki is a handy tool for presenting content and key information in a structured and visually pleasing way. Infoboxes are useful for any kind of MediaWiki project and can provide your readers with a quick snapshot of important data and details. In...

How to Install a MediaWiki Skin

In MediaWiki, skins determine the visual appearance of your wiki website. Skins define how content is presented to users and include such settings for the overall website layout, typography, color scheme, and more. By default, when you install MediaWiki, the platform...

How to Create a Page in MediaWiki

Creating pages in MediaWiki is а core feature that allows you to add content to your MediaWiki website. Whether you are adding details for a project, contributing to a knowledge base, or anything else, learning how to create a page in MediaWiki is crucial for your...



Create a website for free!


Free forever

Our Support Team is Here to Help

 

If you need any questions answered, don't hesitate and contact us. Click the button below and follow the instructions. You can expect an answer within an hour.

 

Contact AwardSpace

 

iNewest knowledge base articles

How to Find Modules in MediaWiki

After you install MediaWiki, log in to the CMS, and presumably install extensions, it is time to learn how to find modules in MediaWiki.   What are MediaWiki Modules Modules in MediaWiki are Lua-based scripts that allow you to add various functionalities to your...

How to Fix MediaWiki Internal Error: A Step-By-Step Guide

MediaWiki Internal Error message can be very frustrating and can significantly harm your MediaWiki project. Luckily, the issue can be fixed in a few easy-to-follow steps to get your website up and running in no time. There are various causes for the issue: Incorrect...

How to Add Infobox Module in MediaWiki

The Infobox in MediaWiki is a handy tool for presenting content and key information in a structured and visually pleasing way. Infoboxes are useful for any kind of MediaWiki project and can provide your readers with a quick snapshot of important data and details. In...

How to Install a MediaWiki Skin

In MediaWiki, skins determine the visual appearance of your wiki website. Skins define how content is presented to users and include such settings for the overall website layout, typography, color scheme, and more. By default, when you install MediaWiki, the platform...

How to Create a Page in MediaWiki

Creating pages in MediaWiki is а core feature that allows you to add content to your MediaWiki website. Whether you are adding details for a project, contributing to a knowledge base, or anything else, learning how to create a page in MediaWiki is crucial for your...

How to Install MediaWiki Extensions

Now that you have installed MediaWiki and learned how to log in to the CMS, it is time to extend MediaWiki's functionality via extensions. MediaWiki extensions are sets of files that add various types of functionality to your MediaWiki website. You can use extensions...

Even more web tutorials

Check out our web hosting knowledge base and the WordPress tutorials to learn more, and be better prepared for your website creation and maintenance journey.