Do you want to add spaces or indents for paragraphs in WordPress? The main part of your texts on the site is left justified, but sometimes you may need to add indents for the first line of the paragraph to improve the readability of the text. In this article, we will show you how easy it is to add indents for paragraphs in WordPress.
Method 1: Use The Buttons To Add Indents In The Visual Editor
By default, most WordPress themes will display paragraphs aligned to the left.
If you want to indent a paragraph, this can be done by clicking on the “Increase indent” button in the editor. Add an empty space to the left of the paragraph.
In case you need to select more than one paragraph, you will need to select them and press the specified button again.
By the button you can press the required number of times, and the indent will increase all the time. Also, the space can be reduced by clicking on the “Reduce indent” button.
Method 2: Indent The Paragraph Manually In A Text Editor.
Using the corresponding button in the visual editor is the easiest way to add indentation. However, the button will not allow you to control the number of spaces to add.
More advanced users can switch to a text editor and manually add indents. To do this, wrap the paragraph text in <p> and </ p> tags, and then add inline CSS to them like this:
1
<
p
style
=
"padding-left:25px;"
>Здесь текст вашего абзаца...</
p
>
This method allows you to control the void that you want to use as an indent. The method is suitable if you do not need to add indents too often.
Method 3: Indent Only The First Line Of The Paragraph
Pages on the web do not use the traditional paragraph spacing used by word processors, which, in turn, add indents to the first paragraph line only.
Even in WordPress, when you indent a paragraph, this space is added to the entire paragraph.
Some news and magazine sites may want to add more traditional indentation. In this case, you will need to add arbitrary CSS code to your theme.
To get started, go to Appearance »Customize to launch customizer WordPress theme. Now click on the “Custom CSS” tab.
You will see a text entry area on the left, where you need to add the following code:
1 |
p.custom-indent { |
2 |
text-indent : 60px ; |
3 |
} |
This CSS code simply tells the browser that if the paragraph has a class .custom-indent class, then you need to add 60px for the text-indent.
Now, go to record editing and switch to a text editor. Then we wrap the paragraph in the tags <p class = ”custom-indent”> and </ p> like this:
1 |
< p class = "custom-indent" >Here is the text of your paragraph ...</ p > |
We look at the “receded” first line of the paragraph.
This method is useful if you need to draw a few paragraphs. However, if you want to add these styles to all the paragraphs on the site, then the code will need to be changed to:
1 |
article p { |
2 |
text-indent : 60px ; |
3 |
} |
This CSS rule will automatically indent the first line of each paragraph within a post or page.
We hope this article has helped you learn how to add paragraph indentation in WordPress.