search
HomeCMS TutorialWordPressGuide to adjusting font size in WordPress

Changing the font size in your WordPress site can be done quickly and easily for a small section of text, but it may require more work if you want to make changes to a larger section of text. p>

In this quick tutorial, I will show you how to change font size in your WordPress website.

I will show you two quick methods:

  • Change font size within a single block
  • Add a CSS class to the block and then style the class

I'll also show you how to change the font size for your entire website by editing your stylesheet.

If you want to learn how to add a brand new font to WordPress or change the font color, you can learn how here too.

How to change the font size of a text block

Let's start with the fastest method.

When you edit text in a WordPress post, you can choose to make a block of text a different font size than other blocks on the page.

This helps highlight specific parts of the page.

You should use this method with caution: too much can make your site look cluttered and unprofessional. If you do this multiple times, make sure to use the same font size for all larger or smaller sections of text.

Start by finding the block of text you want to change the font size of.

在 WordPress 中调整字体大小的指南

In the Blocking pane on the right side of the screen, open the Text Settings tab.

在 WordPress 中调整字体大小的指南

Here you can choose to make the text larger or smaller, or specify an exact font size for it. I've increased the font size to medium:

在 WordPress 中调整字体大小的指南

You can enhance it further and make it larger, but be careful not to make your site look cluttered.

Alternatively, choose a specific font size and make sure to use it for all larger or smaller font blocks on your website.

Finally, click Update to update your post, or Publish to publish it. This will save your changes.

How to change font size using CSS classes

If you want to ensure that all larger blocks of text are the same size, and don't want to remember which size you used, you can use a CSS class to assign a consistent font size class to all elements.

Find your text block again and open the Advanced tab in the Blocks pane.

在 WordPress 中调整字体大小的指南

In the Other CSS Classes field, enter the CSS class. I will use text-large:

在 WordPress 中调整字体大小的指南

Now click Update or Publish to save your post.

You now have two options for editing the size of a block using this class:

  • Add styles in the customizer.
  • Add the style to the theme's stylesheet.

Styling a class in the customizer is the easiest way and won't cause you any problems when updating your theme.

Go to Appearance > Customize in the WordPress admin center and click Additional CSS.

在 WordPress 中调整字体大小的指南

In the Other CSS pane, enter the following to make the text larger: p>

.text-large {
 font-size: 1.2em;
}

Using em instead of a specific font size will make the text 1.2 times the size of a normal paragraph.

在 WordPress 中调整字体大小的指南

Click the Publish button to save your changes.

Now go to the post in your live site and you will see that the block with the class text-large is larger than the text around it:

在 WordPress 中调整字体大小的指南

If you want to increase the size further, just edit the CSS in the customizer. Now, whenever you want a block to grow, you just assign it that class and the font size will change for you.

Change font size in theme stylesheet

With the two methods I showed you don’t need to edit the files in your theme or have a deep understanding of CSS. They provide you with a quick way to change WordPress font size.

However, if you want to edit the size of existing elements in your site (such as all paragraphs or lists), or if you want to add CSS in the stylesheet instead of the customizer, you will need to edit your theme's stylesheet.

You can find more information about editing stylesheets in our guide to adding custom CSS to your WordPress site. If you want to go deeper, this is a great place to start.

in conclusion

Changing the font size of text in your WordPress site may take a few minutes. You can edit the block's font size directly, or you can assign it a class and write CSS for your class.

No matter which method you use, use it sparingly for maximum effect and to ensure you don't end up with a website that looks cluttered and unprofessional.

Make your website beautiful with a professional WordPress theme

Are you revamping your WordPress website? Our collection of professionally designed WordPress themes can give your website a new look and feel in minutes.

在 WordPress 中调整字体大小的指南

Here are some of the best-selling and emerging WordPress themes launched in 2020 by ThemeForest. p>

The above is the detailed content of Guide to adjusting font size in WordPress. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Can I learn WordPress in 3 days?Can I learn WordPress in 3 days?Apr 09, 2025 am 12:16 AM

Can learn WordPress within three days. 1. Master basic knowledge, such as themes, plug-ins, etc. 2. Understand the core functions, including installation and working principles. 3. Learn basic and advanced usage through examples. 4. Understand debugging techniques and performance optimization suggestions.

Is WordPress a CMS?Is WordPress a CMS?Apr 08, 2025 am 12:02 AM

WordPress is a Content Management System (CMS). It provides content management, user management, themes and plug-in capabilities to support the creation and management of website content. Its working principle includes database management, template systems and plug-in architecture, suitable for a variety of needs from blogs to corporate websites.

What is the WordPress good for?What is the WordPress good for?Apr 07, 2025 am 12:06 AM

WordPressisgoodforvirtuallyanywebprojectduetoitsversatilityasaCMS.Itexcelsin:1)user-friendliness,allowingeasywebsitesetup;2)flexibilityandcustomizationwithnumerousthemesandplugins;3)SEOoptimization;and4)strongcommunitysupport,thoughusersmustmanageper

Should I use Wix or WordPress?Should I use Wix or WordPress?Apr 06, 2025 am 12:11 AM

Wix is ​​suitable for users who have no programming experience, and WordPress is suitable for users who want more control and expansion capabilities. 1) Wix provides drag-and-drop editors and rich templates, making it easy to quickly build a website. 2) As an open source CMS, WordPress has a huge community and plug-in ecosystem, supporting in-depth customization and expansion.

How much does WordPress cost?How much does WordPress cost?Apr 05, 2025 am 12:13 AM

WordPress itself is free, but it costs extra to use: 1. WordPress.com offers a package ranging from free to paid, with prices ranging from a few dollars per month to dozens of dollars; 2. WordPress.org requires purchasing a domain name (10-20 US dollars per year) and hosting services (5-50 US dollars per month); 3. Most plug-ins and themes are free, and the paid price ranges from tens to hundreds of dollars; by choosing the right hosting service, using plug-ins and themes reasonably, and regularly maintaining and optimizing, the cost of WordPress can be effectively controlled and optimized.

Is WordPress still free?Is WordPress still free?Apr 04, 2025 am 12:06 AM

The core version of WordPress is free, but other fees may be incurred during use. 1. Domain names and hosting services require payment. 2. Advanced themes and plug-ins may be charged. 3. Professional services and advanced features may be charged.

Is WordPress easy for beginners?Is WordPress easy for beginners?Apr 03, 2025 am 12:02 AM

WordPress is easy for beginners to get started. 1. After logging into the background, the user interface is intuitive and the simple dashboard provides all the necessary function links. 2. Basic operations include creating and editing content. The WYSIWYG editor simplifies content creation. 3. Beginners can expand website functions through plug-ins and themes, and the learning curve exists but can be mastered through practice.

Why would anyone use WordPress?Why would anyone use WordPress?Apr 02, 2025 pm 02:57 PM

People choose to use WordPress because of its power and flexibility. 1) WordPress is an open source CMS with strong ease of use and scalability, suitable for various website needs. 2) It has rich themes and plugins, a huge ecosystem and strong community support. 3) The working principle of WordPress is based on themes, plug-ins and core functions, and uses PHP and MySQL to process data, and supports performance optimization.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!