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 Remove a Product in OpenCart

After installing OpenCart and logging in to the dashboard, you can start adding and removing products immediately. We have already covered how to add products in OpenCart, and in this article, we share simple steps to delete products from your store with only a few...

How to Add Products in OpenCart

The most important element in your OpenCart project is the products you will offer your site visitors. In the following paragraphs, we share how to add products to your OpenCart website.   How to Create Products in Opencart The process of adding new products in...

How to Log in to OpenCart

After you install OpenCart, you can log in to the platform and start working on your project right away. To log in, you should open the OpenCart login page and enter the credentials you chose when installing the CMS. This will open the platform’s admin panel. In the...

How to Install OpenCart

You can install OpenCart on every AwardSpace web hosting plan, including our free web hosting, shared hosting, and advanced AwardSpace services such as Semi-Dedicated Hosting and VPS hosting. Keep in mind that all of the AwardSpace hosting services are tailored to run...

How to Change My Last Name in Moodle

If you are asking yourself "How to change my last name in Moodle", then you are at the right place. This guide will walk you through the steps for changing your last name in Moodle while addressing common concerns like ratings and discussions.   How to Change My...



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 Remove a Product in OpenCart

After installing OpenCart and logging in to the dashboard, you can start adding and removing products immediately. We have already covered how to add products in OpenCart, and in this article, we share simple steps to delete products from your store with only a few...

How to Add Products in OpenCart

The most important element in your OpenCart project is the products you will offer your site visitors. In the following paragraphs, we share how to add products to your OpenCart website.   How to Create Products in Opencart The process of adding new products in...

How to Log in to OpenCart

After you install OpenCart, you can log in to the platform and start working on your project right away. To log in, you should open the OpenCart login page and enter the credentials you chose when installing the CMS. This will open the platform’s admin panel. In the...

How to Install OpenCart

You can install OpenCart on every AwardSpace web hosting plan, including our free web hosting, shared hosting, and advanced AwardSpace services such as Semi-Dedicated Hosting and VPS hosting. Keep in mind that all of the AwardSpace hosting services are tailored to run...

How to Change My Last Name in Moodle

If you are asking yourself "How to change my last name in Moodle", then you are at the right place. This guide will walk you through the steps for changing your last name in Moodle while addressing common concerns like ratings and discussions.   How to Change My...

How to Change Your Name in Moodle

Changing your name in Moodle is a very simple task and requires only a few minutes of your time.   How to Change My Name in Moodle The process is comprised of a few easy-to-follow steps:   Step 1: Log in to Moodle After installing the CMS, you should log in...

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.