What is p in HTML

Define paragraphs of text

Paragraphs serve to visually structure a text. When creating HTML files, it is not enough to insert a hard break in the editor. WWW browsers ignore such breaks (see also  Rules for editing HTML).

Example:

 Display example: This is what it looks like

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Text des Titels</title> </head> <body> <h1>Textabs&auml;tze definieren</h1> <p>Hier beginnt ein Absatz, und hier ist er zu Ende.</p> <p>Hier beginnt ein neuer Absatz, und hier ist er zu Ende.</p> </body> </html>

Explanation:

(p = paragraph = paragraph) introduces a paragraph of text. ends the text paragraph and is at the end of the paragraph text.

Note:

Single tags, as they used to be allowed, are no longer HTML-compliant. Always write down paragraphs of text with an opening and closing tag.

The element must not contain any other block-generating elements such as headings, paragraphs of text, lists, quotations or addresses.

The statements about apply to the paragraph text  Character set, special characters and HTML-specific characters.

  

Align paragraphs of text

Paragraphs of text are left-justified unless you specify otherwise. You can also center or right justify a paragraph of text. Justification is also possible.

Example:

 Display example: This is what it looks like

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Text des Titels</title> </head> <body> <h1>Textabs&auml;tze ausrichten</h1> <p align="center">Dies ist ein zentrierter Absatz.</p> <p align="right">Dies ist ein Absatz, der rechts ausgerichtet ist.</p> </body> </html>

Explanation:

By specifying in the introductory tag you can ensure that the text paragraph is centered (align = alignment, center = centered). With the paragraph is aligned right (right = right). With you force the justification for the paragraph (justify = adjust). With you can specify the normal setting (left-justified).

Note:

Not all browsers can use justification.

is in the HTML 4 standard as deprecated (deprecated) classified. Instead, it is recommended to use CSS stylesheets, e.g .:. For more information, see the following section.

  

Formatting paragraphs of text with CSS

You have no control over how the text of a paragraph is displayed with HTML. The browsers use default formatting to display the text. With  CSS stylesheets however, you can format your paragraphs of text as you wish. The first thing you need to know when using CSS stylesheets is how to  Define CSS formats can. You will then be able to apply CSS properties. The following CSS properties are decisive in the context described here:
 Font formatting
 Alignment and sales control
 Outer edge and spacing
 Padding
 frame
 Background colors and images

Example:

 Display example: This is what it looks like

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Text des Titels</title> </head> <body> <h1>Textabs&auml;tze formatieren</h1> <p style="font-family:Arial,sans-serif; font-size:18px; color:blue">Ein formatierter Absatz.</p> <p style="background-color:yellow">Ein anderer formatierter Absatz.</p> </body> </html>

Explanation:

Two paragraphs are defined in the example. The first is determined to be displayed in the Arial font or another sans serif font, has a font size of 18 pixels and is blue. The second paragraph is given a yellow background color.

  

additional Information

In the  HTML reference you will find information about where paragraphs of text may appear, which other elements they may contain, which attributes they can have and what needs to be considered for the individual attributes:
 Element reference for paragraphs of text
 Attribute reference for paragraphs of text

© 2001 [email protected]