-
HTML Choosing Editors
-
HTML Basic Structure
-
HTML Head
-
HTML Element
-
HTML Attribute
-
HTML Headings
-
HTML Paragraphs
-
HTML Style
-
HTML Formatting
-
HTML Colors
-
HTML CSS
-
HTML Comments
-
HTML Links
-
HTML Images
-
HTML Table
-
HTML List
-
HTML Block and Inline
-
HTML Class & Id
-
HTML iFrames
-
HTML JavaScript
-
HTML File Paths
-
HTML Layout
-
HTML Responsive
-
HTML Style Guide
-
HTML Forms
HTML Paragraphs
HTML paragraphs (<p>) are fundamental elements for structuring and formatting text content on a web page. They are used to group and separate blocks of text, making your content more readable and organized. In this tutorial, we’ll explore how to create paragraphs, manage line breaks, handle white spaces, and work with preformatted text using HTML.
Creating Paragraphs
To create a paragraph in HTML, you use the <p> element. You open a paragraph with an opening <p> tag and close it with a closing </p> tag. Any text or content placed between these tags is considered part of the paragraph.
Creating Line Breaks
HTML provides the <br> element to insert line breaks within text content. Unlike paragraphs, <br> tags do not require a closing tag because they are considered empty elements.
Managing White Spaces
HTML normalizes white spaces (spaces, tabs, and line breaks) within text content. It treats consecutive white spaces as a single space. To preserve multiple spaces or format text with precise white spaces, you can use the HTML entity , which represents a non-breaking space.
Defining Preformatted Text
HTML offers the <pre> element to display text exactly as it appears in the source code, preserving white spaces and line breaks. This is useful for displaying code snippets, poetry, or any text where formatting matters.
HTML paragraphs are essential for structuring and formatting text content. They help create clear divisions in your content, making it more readable. Additionally, line breaks, white space management, and preformatted text provide tools for precise control over how text is presented on your web page.