前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >How to Easily Add Custom CSS

How to Easily Add Custom CSS

作者头像
妍小妍
发布2022-09-22 15:18:06
2570
发布2022-09-22 15:18:06

Do you want to add Custom CSS to change the look and feel of your site?.

Adding custom CSS helps you change the layout and appearance of your website, which is not possible through default options. Using FTP is too confusing for most beginners, but there are other ways to add custom CSS.

In this article, we will show you how to easily add custom CSS to your WordPress site without editing any theme files.

How to Easily Add Custom CSS
How to Easily Add Custom CSS
Why Add Custom CSS in WordPress?

CSS is short for Cascading Style Sheets and is a language that helps you style your WordPress website. CSS and HTML go together as CSS is used to style different HTML elements like color, size, layout, and display. 

Adding custom CSS helps customize the design and appearance of your site, which isn’t possible through the default options. It gives you more control, and you can easily make changes to your WordPress theme with a few lines of code. 

For example, let’s say you want to change the background color of each individual post instead of using the same color throughout the website. By adding a custom CSS code, you can personalize the background of a specific post or page. 

Similarly, you can change the style and appearance of product categories on your eCommerce store using additional CSS. 

That said, let’s take a look at different ways you can add custom CSS to your WordPress website. You can click the link below to jump ahead to any section you’re interested in:

Method 1: Adding Custom CSS Using Theme Customizer

Since WordPress 4.7, users can now add custom CSS directly from the WordPress admin area. This is super-easy, and you will be able to see your changes with a live preview instantly.

First, you need to head over to the Appearance » Customize page from your WordPress dashboard.

How to Easily Add Custom CSS
How to Easily Add Custom CSS

This will launch the WordPress theme customizer interface.

You will see your site’s live preview with a bunch of options on the left pane. Click on the ‘Additional CSS’ tab from the left panel.

How to Easily Add Custom CSS
How to Easily Add Custom CSS

The tab will slide to show you a simple box where you can add your custom CSS. As soon as you add a valid CSS rule, you will be able to see it applied on your website’s live preview pane.

How to Easily Add Custom CSS
How to Easily Add Custom CSS

You can continue adding custom CSS code until you are satisfied with how it looks on your site.

Don’t forget to click on the ‘Publish’ button on the top when you are finished.

Note: Any custom CSS that you add using theme customizer is only available with that particular theme. If you would like to use it with other themes, then you will need to copy and paste it to your new theme using the same method.

Method 2: Adding Custom CSS Using a Plugin

The first method only allows you to save custom CSS for the currently active theme. If you change the theme, then you may need to copy and paste your custom CSS to the new theme.

If you want your custom CSS to be applied regardless of which WordPress theme you are using, then this method is for you.

The first thing you need to do is install and activate the Simple Custom CSS plugin. If you need help, then please see our guide on how to install a WordPress plugin

Upon activation, simply go to Appearance » Custom CSS and write down or paste your custom CSS.

How to Easily Add Custom CSS
How to Easily Add Custom CSS

Don’t forget to press the ‘Update Custom CSS’ button to save your changes.

You can now view your WordPress website to see the custom CSS in action.

Method 3: Adding Additional CSS with Full Site Editor (FSE)

Another way you can add custom CSS in WordPress is by using the Full Site Editor (FSE). With FSE, you can edit the layout and design of the entire website using the WordPress block editor, just like when editing a blog post or page. 

Do note that the full site editor is only available for selected themes. For more details, you can see our article on the best WordPress full site editing themes.

Using a plugin to add CSS is a bit easier. That said, if you prefer to not use a plugin, then we’ll show you how to access the customizer even when it’s no longer available in your admin menu.

All you need to do is log in to your WordPress admin.

Then, simply copy and paste the URL below into your browser, and replace ‘example.com’ with your own website’s domain name.

https://example.com/wp-admin/customize.php

This will bring you to a limited version of the theme customizer. In the menu on the left, you should see the option for adding custom CSS at the bottom.

Simply click the ‘Additional CSS’ tab. 

How to Easily Add Custom CSS
How to Easily Add Custom CSS

Now go ahead and enter your CSS code under the Additional CSS area. 

After adding the code, simply click the ‘Publish’ button. 

How to Easily Add Custom CSS
How to Easily Add Custom CSS
Using a Custom CSS plugin vs Adding CSS in Theme

All methods described above are recommended for beginners. Advanced users can also add custom CSS directly to their themes.

However, adding custom CSS snippets into your parent theme is not recommended. Your CSS changes will be lost if you accidentally update the theme without saving your custom changes.

The best approach is to use a child themeinstead. However, many beginners don’t want to create a child theme. Apart from adding custom CSS, often beginners really don’t know how they will be using that child theme.

Using a custom CSS plugin allows you to store your custom CSS independently from your theme. This way, you can easily switch themes, and your custom CSS will still be there.

Another great way to add custom CSS to your WordPress site is by using the CSS Hero plugin. This wonderful plugin allows you to edit almost every CSS style on your WordPress site without writing a single line of code.

How to Easily Add Custom CSS
How to Easily Add Custom CSS

You can also add custom CSS with the SeedProd plugin. SeedProd is a drag and drop website builder that allows you to create custom WordPress themes and landing pages for your WordPress site. You can easily edit the global CSS settings, no code required. 

How to Easily Add Custom CSS
How to Easily Add Custom CSS

We hope this article helped add custom CSS to your WordPress site. You may also want to see how our guide on how to choose the best web design software, and the best WordPress drag & drop page builder plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Why Add Custom CSS in WordPress?
  • Method 1: Adding Custom CSS Using Theme Customizer
  • Method 2: Adding Custom CSS Using a Plugin
  • Method 3: Adding Additional CSS with Full Site Editor (FSE)
  • Using a Custom CSS plugin vs Adding CSS in Theme
相关产品与服务
网站建设
网站建设(Website Design Service,WDS),是帮助您快速搭建企业网站的服务。通过自助模板建站工具及专业设计服务,无需了解代码技术,即可自由拖拽模块,可视化完成网站管理。全功能管理后台操作方便,一次更新,数据多端同步,省时省心。使用网站建设服务,您无需维持技术和设计师团队,即可快速实现网站上线,达到企业数字化转型的目的。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档