When typing certain texts or even tables, webmasters have to deal with such a problem as typing red lines, indents in the text. It would seem that everything is quite simple - copy the text to the desired field, and the indentation will be automatic. But, unfortunately, not everything is so simple. Therefore, let's figure out how to format text correctly so that it looks beautiful and effective, and find out how to indent HTML.
Method one
Let's start with the most simple, but at the same time time-consuming indentation. To solve this problem, use the space code - & nbsp ;. Using it at the beginning of the paragraph several times, you will get the indent you need.
The advantages of this method are that this code is read by any browser. There is only one drawback - you will have to insert spaces into your chosen text for a long and tedious period. This method is suitable for those who are just starting out with HTML. Indentation in the table can also be done in this way.
Second way
The second way is to indent using the paired <blockquote tag. To do this, enclose the text that you need to format between the opening and closing tags.
Easier than in the first case. But the trouble is, this tag indent only 40 pixels, in addition, when using it, the indent is set not only on the left, but also on the right, above and even below. For text, itβs not always beautiful; for a table, such a way to indent HTML will be much more efficient.
If you want to highlight the information block beautifully - this tag is suitable, if not - we recommend using the first method or looking at the remaining two.
Third way
We substitute the word whose letters have the same color as the background, that is, at the beginning of each paragraph we insert the invisible word. This makes it easy to indent. HTML allows you to write special code once and paste it at the beginning of each paragraph.
Yes, the solution is not bad, but what if your site has a wallpaper or picture? This method will not work here. And besides, when highlighting this word will be visible. And remember that this code will be available to all Internet users. In this case, viewing the source code of your page, users may be at a loss. Therefore, we still recommend using special tags for indentation. Also note that this design option is not entirely suitable for tables, although it can be used to format text.
The fourth way
And finally, the last ways to indent text. In HTML, this can be done with two simple tags. And the easiest way to make a paragraph is to use a bunch of two tags - <br> <dd>.
The first tag wraps the text on a new line, forming a paragraph. The second serves as a tabulator, that is, sets the red line. As you can see, everything is quite simple and clear. In addition, such a record will be understandable to most users who have looked at your site and are interested in its code.
Using this combination is easy, although it will have to be inserted at the beginning of each paragraph manually. But what to do, not all editors have the ability to beautifully and correctly format text.
Do I need a paragraph tag?
Finally, let's talk a little about the <p> tag. It is usually used to determine the beginning of a new paragraph in a text. True, when using this tag, the red line in the paragraph is not saved , but indentation appears between paragraphs.
In most European countries, this design is generally accepted, but does it suit us? We are all accustomed to the presence of red lines and quite often ask ourselves how to indent HTML, and it is not always convenient to read text formatted in this way.
If you want to make the text more familiar and easy to read, we advise you to abandon the <p> tag and replace it with a bunch of <br> <dd>. Believe me, it will be much more beautiful and elegant than the presence of empty lines between paragraphs. And so you can save space on the screen.
conclusions
So, we have learned how to indent. As it turned out, this is not so difficult. The main thing is to know some useful tags and codes, as well as have a margin of patience and free time to arrange them.
There are several ways to indent HTML. We have disassembled each of them, highlighted their advantages and disadvantages. We also talked about the fact that the <p> tag is far from always as useful as we would like.