This article will explore some features linked to the organization of paragraphs and text blocks. Remember that the purpose of HTML is to allow the structuring of content.
The tags <h1>, <h2>, <h3> <h4> <h5> and <h6> are used to mark an area of the document that indicates a header – head (a title or caption, for example). The lower is the value, the more highlight presentation of the header will receive. The headers are shown in bold and, at the end thereof, a line break is made. The use of headers demarcates an area of text that deserves highlighting, and is normally used to start it, stating, for example, the title of it. Optionally, you can use the align parameter to indicate the alignment of the header: right, left or center.
The <p> (paragraph) tag demarcates a text paragraph. Splitting a text into paragraphs is an activity present in any newsroom. Associated with the <p> tag, there is a parameter called align which informs the alignment of the text, which can be centralized (center), justified (justify), left-aligned (left) or right-aligned (right). The use of the <p> tag solely, such as <p> </ p> produces a line break. However, there is a special tag for this purpose.
There are situations in which we have the need to maintain the presentation of a text as it is typed (ie, respecting spaces and tabs and line breaks). A typical situation where this occurs is when we need to represent an example of a programming language.
In this case, the indicated option is the <pre> tag (predefined). Its visual effect is a left indent and the text presentation in a fixed-size font such as the one used when it was typed (respecting linebreaks, spaces and tabs). The <pre> tag, at the time the code is viewed, keeps text positions as they have been predefined in the HTML document.
The browser ignores line breaks informed throughout the text. To produce the desired effect, we must use the tag <br /> (break) that is independent, ie, does not need another tag to close it, and it is enough to indicate in the opening instruction itself, the signal “/” to close it automatically.
The <hr /> (head row) has the same principle of the <br /> tag, but its effect is the production of a line that divides the page horizontally. Its aim is to produce division of sections over content
Finally, the <font> tag acts on text attributes itself. In summary, there are three attributes that we can change: the size (size), the type (face) and color (color). The size is defined as the use of an integer and can be used absolutely (directly with the number) or relatively, indicating, through the positive (+) or negative (-) signs, the increment or decrement value in relation to the default browser. The absolute value for the size attribute (which defines the size) can vary between 1 and 7 – the higher the number, the greater the size of its display.
Check out more content on our blog.