How to center justify single line of text

[ad_1]

In the WordPress block editor I am adding categories like below. I’m trying to center the category line “PLUMBERS” while left justifying the next three lines.

**PLUMBERS**
Joe’s Plumbing: 202-555-1234
Sally’s Plumbing: 202-555-3567
Apple Plumbing: 202-555-4590

If I press Shift+Enter to keep the lines close together it treats it as one paragraph and I have to have the same justification for all four lines.

If I press Enter after the first line I can justify that line differently but I hope to keep the lines together to save space.

**PLUMBERS**

Joe’s Plumbing: 202-555-1234
Sally’s Plumbing: 202-555-3567
Apple Plumbing: 202-555-4590

Is there a way to center the top line while eliminating the vertical gap between the first and second line?

I’ve looked in vain for a solution. Thanks!

[ad_2]
1 Comment
  1. If you want to style it in-line instead of using CSS then switch it to code view and use a header tag for the heading and style it to centre-align the header separately from the paragraph. Then use paragraph text for the entries and line breaks to separate:

    <h3 style=”text-align:center; text-transform:uppercase;”>Plumbers </h3>
    <p style=”text-align:left;”>
    Joe’s Plumbing: 202-555-1234<br>
    Sally’s Plumbing: 202-555-3567<br>
    Apple Plumbing: 202-555-4590<br>
    </p>

    You can also use two paragraph blocks, just change “h3” to “p”.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer