HTML Basics: Structuring website text logically using paragraphs. How is a paragraph created in HTML?

Creating Paragraphs with the P Tag

Paragraphs usually consist of several sentences. They are used to structure the text and organize your thoughts. A new paragraph always starts on a new line, and is a marker for a small pause in speech or the beginning of a new idea.

The HTML <p> Tag

P elements are block elements, in which only inline elements may be used.

The HTML P-Tag indicates a paragraph. A paragraph always starts with <p> and has to be closed with </p>. The HTML P element corresponds to the paragraph in a word processor, like Microsoft Word, for example.

The following HTML elements in particular are typically used in paragraphs:

The following HTML elements are never or very rarely used:



Block elements inside a paragraph are not allowed, e.g.:

The content of the P tag is displayed in most web browsers with a font size of 1em (16 pixels) without any style adjustment using CSS. The default font is Times New Roman. The line height and font family can only be changed using CSS.

By default, the line height is 120% of the font size. The P element has space at the top and bottom in all web browsers.

Text in a P element always uses the full width of its parent container. Line breaks, consecutive spaces, and tabs in the HTML code are ignored. The HTML BR tag can be used to insert a forced line break without starting a new paragraph.

Example

A paragraph is created by using the HTML <p> tag.

<p>A wonderful serenity has taken over my whole soul, like the sweet spring mornings that I enjoy with all my heart. I am alone and enjoy my life in this region, which is made for such souls as mine. I am so happy, my dearest, so completely absorbed in the feeling of peaceful existence, that my art suffers as a result.<br><br>
<cite>
Johann Wolfgang von Goethe, 
The Sorrows of Young Werther
</cite></p>
Output of the HTML code

A wonderful serenity has taken over my whole soul, like the sweet spring mornings that I enjoy with all my heart. I am alone and enjoy my life in this region, which is made for such souls as mine. I am so happy, my dearest, so completely absorbed in the feeling of peaceful existence, that my art suffers as a result.

Johann Wolfgang von Goethe, The Sorrows of Young Werther