The Block Editor (Gutenberg) is the default editor in modern versions of WordPress. It offers flexibility with blocks for different content types. Here are a few ways to achieve indentation using the Block Editor.
Using the Block Quote Block
The Quote Block is one of the simplest ways to indent text in Gutenberg. It automatically applies a margin to make the text stand out.
Steps to use the Quote Block for Indentation:
- Open your WordPress post in the Block Editor.
- Select the paragraph you want to indent.
- Click the + (Add Block) button and search for “Quote.”
- Paste or type your text into the Quote Block.
This method is quick and doesn’t require any coding knowledge. However, it adds quotation formatting, which might not always be suitable.
Adding Custom CSS for Indentation
If you want precise control over indentation, adding custom CSS can help.
Steps to Add Custom CSS:
- Go to Appearance > Customize > Additional CSS in your WordPress dashboard.
Add the following CSS code:
css
.custom-indent {
padding-left: 30px;
}
- In the Block Editor, select the block you want to indent.
- Go to the Advanced Settings in the sidebar and add custom-indent to the “Additional CSS Class” field.
This method gives you consistent indentation across your posts.
Indenting with the Preformatted Block
The Preformatted Block retains spacing and indentation as typed, making it perfect for code snippets or structured text.
How to Use the Preformatted Block:
- Click the + (Add Block) button and select Preformatted.
- Type or paste your text with the desired indentation.
The Preformatted Block respects spaces and tabs, ensuring your text maintains its layout.
Leave a Reply