Advertisement
Google Ad Slot: content-top
Paragraph
In HTML, a paragraph is defined using the <p> tag. It is a block-level element that is used to group and display a block of text, creating a new paragraph in the document. By default, paragraphs are separated from each other by some space, providing a clear visual distinction between different blocks of text.
- Block-Level Element: As a block-level element, a
<p>tag will start on a new line and take up the full width available. - Text Formatting: Inside a paragraph, you can include inline elements like
<span>,<a>,<strong>,<em>, and others to format parts of the text. - Whitespace Handling: HTML collapses multiple spaces and line breaks within a paragraph into a single space. For example:
Example
<!DOCTYPE html>
<p>This is the first paragraph. It contains some text that forms a complete thought or idea.</p>
<p>This is a <strong>bold</strong> word, and this is an <em>italic</em> word in a paragraph.</p>
Paragraph Output