Don’t know how to center text in WordPress? Read this guide as it teaches various methods to achieve that.
How To Center Text In A Specific Post/Page
There are two major ways you can align text to the middle of a WordPress post or page. You can either make use of the text alignment tool in the WordPress block editor or use HTML.
Well, the following sub-sections will demonstrate how to center-align text in a WordPress post/page using those methods.
Option 1: Center Text in a Specific Post/Page Using Text Alignment Tool
- Sign in to your WordPress site’s backend dashboard using an administrator account. Then, click Posts or Pages among the options on the dashboard’s left pane, depending on where you want to center a text.
- Afterward, open the page/post where you wish to center the text by left-clicking its title. For this example, I will open an untitled post on our WordPress site.
- When the post/page opens, click the block with the text you wish to align to the center. Now, click the Align icon in the toolbar above the block, then select Align text center from the displayed options.
Option 2: Center Text in a Specific Post/Page Using HTML
- Log on to your WordPress site’s backend dashboard using an administrator account. Next, depending on where you want to center a text, click Posts or Pages among the options on the dashboard’s left pane.
- Following that, left-click the title of the page/post where you want to center-align the text to open it. For this demonstration, I will open an untitled post on our WordPress site.
- When the page/post opens, click the Options icon (three vertical dots) at the top right corner. Then, select Code editor from the displayed options.
- Now, input the following HTML code in the opening paragraph or header HTML tag that wraps around the text you want to align to the middle.
class="has-text-align-center"
- After doing that, click Exit code editor. Hence, the text will be aligned to the center – see the second screenshot.
How To Center Text Across Site
Interestingly, with a simple CSS code, you can align the text across your WordPress site to the middle. The step-by-step procedures below demonstrate how to achieve that.
- Log in to your WordPress site’s backend as an admin. Then, hover your mouse cursor on Appearance on the backend’s left pane and select Customize from the displayed options.
- On the Customize page, select Additional CSS on the left pane.
- Now, input the following CSS code in the Additional CSS input field.
.entry-content { text-align: center; }
- Finally, click the blue Publish button at the top of the page to save the change.
Frequently Asked Questions
To change the alignment of text in a WordPress post or page, follow the steps below.
a) Sign in to your WordPress site’s backend dashboard using an administrator account.
b) Then, click Posts or Pages among the options on the dashboard’s left pane, depending on where you want to change the alignment of a text.
c) Afterward, open the page/post where you wish to change the alignment of the text by left-clicking its title.
d) When the post/page opens, click the block with the text you wish to change its alignment.
e) Now, click the Align icon in the toolbar above the block, then select your preferred alignment from the displayed options.
Alignment or align is a term used to describe how text is positioned in a paragraph.
Yes, you can align text in WordPress.
There are left alignment, right alignment, center alignment, and justified alignment.
Yes, WordPress is completely free.
Conclusion
Aligning text to the middle in WordPress is a fundamental design skill that can help enhance the visual appeal and readability of your content. Moreover, center-aligned text can easily draw attention to important information on your website.
Also, it can make your site’s content appear more organized and professional. Fortunately, this guide provided multiple ways to center-align text in a specific WordPress post or page.
To be specific, we discussed how to perform the task using the text alignment tool in the WordPress block editor. We also learned how to execute the task using HTML.
Besides that, I also included steps to align text across your WordPress site to the middle using a simple CSS code in this guide.
Hopefully, you found this WordPress guide helpful. If you did, click on “Yes” beside the “Was this page helpful” question below.
You may also express your thoughts and opinions by using the “Leave a Reply” form at the bottom of this page.
Lastly, visit our WordPress & Websites How-to Guides page for more insightful guides like this.