How to apply and increase indentation in WordPress HTML code

WordPress being one of the most used tools to create blogs and web pages allows you to create content without the need for programming knowledge. However, knowing how to use HTML code to modify the text such as increasing the indentation or making the text bold can be helpful.

WordPress themes generally display all left justified text . Depending on the language it may be justified to the right. But if you want to make a change to your texts to make them different from the rest, you can add indents.

Increase indent by HTML code

It is important to clarify before starting you can modify the indentation from the toolbox of WordPress shown the edit an entry or page. But it is a limited function because it does not allow to define the amount of space.

You only require basic knowledge of HTML to perform this action and you do it in a matter of minutes. With everything clear now we can begin.

  • Log in to your WordPress account with your username and password.
  • Add a new entry or enter an already created one that you want to modify.
  • Write all the text of the entry.
  • Change the visual editor and place HTML to switch to HTML editing.
  • Place the <p> text in your code. Each <p> tag represents the beginning of a paragraph in the text and the closing tag is </ p>.
  • Modify the tag as follows: <p style = »padding-left: 20px;»>. The value of 20px can be customized to your liking.
  • If you want to add an indent to all the paragraphs you have to place this same line.

This method is straightforward, but can be cumbersome if you want to indent all paragraphs in all entries. In that case, it is best to directly edit the style sheet of the WordPress theme so that it does it by default for all texts.

Indentation in WordPress CSS code

To add indentation to all the texts on the page, you have to modify the theme, specifically the style sheet. We will use the text-indent property to set the separation (the white space) between the border and the first line of the paragraph.

  • Click on the Appearance option in the WordPress menu and then select the Custom option .
  • Choose the additional CSS option .
  • Type the following: p.ParagraphStart {text-indent: 25px; }.

This indicates that the paragraphs (element p) begin with an indentation of 25px. It works as long as the StartParagraph attribute is included in the page to edit.

If you want to apply this style to a specific paragraph, just do the assignment at the beginning of the paragraph in the HTML code as follows: <p class = «StartParagraph»> .

Customize paragraphs in WordPress with HTML

From the text mode of the WordPress posts, there are multiple configuration options that you have to do in the content. You just need to know a little HTML, which is considered a more language markup tags .

  • Add bold:  use <strong> text </strong> tags to emphasize a piece of text. This tag can go within a paragraph and the words are shown in bold.
  • Place italics:  As simple as placing a text between these two <em> </em> tags.
  • Using the Span tag:  The <span> tag allows you to change a particular text within a paragraph. You can change the style, color and even the size of the text. You just have to place the opening tag before the text and put the attributes <span style = »color: blue;»>
  • Change text size:   change the font size within the opening paragraph tag. <p style = »font-size: 14px;»> Text </p>.

Knowing all the HTML tags, you will not only be able to modify the text as you wish, but you will also be able to recognize each element and identify errors. When you become an advanced user, you can directly edit the appearance of WordPress and get an authentic page.

 

Leave a Comment