In HTML, the <p> element is used to define paragraphs. Paragraphs are block-level elements, and each <p> tag represents a separate paragraph of text.
Here's an example of how to use the <p> element:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Paragraph Example</title>
</head>
<body>
<p>This is the first paragraph. It can contain text, images, links, and other HTML elements.</p>
<p>This is the second paragraph. It allows you to separate and structure content on your web page.</p>
</body>
</html>
Output:
In this example:
- The <p> element is used to define two paragraphs.
- Each paragraph is contained within its own set of <p> tags.
- Paragraphs are block-level elements, so they are displayed with space above and below them, creating a clear separation between paragraphs.