--- id: html-paragraphs title: "HTML Paragraphs" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["paragraph tag", "p element", "br", "pre", "hr", "line break", "preformatted text", "horizontal rule"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.90 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["html", "web", "frontend", "w3schools", "paragraphs", "text"] raw_sources: ["https://www.w3schools.com/html/html_paragraphs.asp"] applied_in: [] github_commit: "" --- # [[HTML Paragraphs]] ## π― ν μ€ ν΅μ°° (One-line insight) The `
` element defines a paragraph that always starts on a new line with browser-added margins, and the browser collapses any extra spaces and blank lines in the source. [S1] ## π§ ν΅μ¬ κ°λ (Core concepts) - **`
` defines a paragraph** β always starts on a new line; browsers add white space (margin) before and after. [S1]
- **Whitespace is collapsed** β the browser automatically removes any extra spaces and lines when the page is displayed. [S1]
- **Display is unpredictable** β you cannot be sure how HTML will display; different screen sizes and resized windows give different results. [S1]
- **`
` is a line break** β inserts a single line break without starting a new paragraph; it is an empty element with no end tag. [S1]
- **`
` preserves formatting** β preformatted text displays in a fixed-width font and keeps both spaces and line breaks. [S1] - **`
` is a thematic break** β defines a thematic change in content, displayed as a horizontal rule. [S1] ## π§© μΆμΆλ ν¨ν΄ (Extracted patterns) - **Don't rely on source whitespace** β formatting must come from tags/CSS, not extra spaces or newlines. [S1] - **`
` for in-paragraph breaks** β use it when you want a new line without a new paragraph. [S1] - **`` for poems/code-like text** β when whitespace and line breaks must be preserved. [S1] ## π μΈλΆ λ΄μ© (Details) **HTML Paragraphs** A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph. The `` element defines a paragraph: [S1] ```html
This is a paragraph.
This is another paragraph.
``` **HTML Display** You cannot be sure how HTML will be displayed. Large or small screens, and resized windows, will create different results. With HTML, you cannot change the display by adding extra spaces or extra lines in your HTML code. The browser will automatically remove any extra spaces and lines when the page is displayed. [S1] **HTML Line Breaks** The HTML `
` element defines a line break. Use `
` if you want a line break (a new line) without starting a new paragraph: [S1] ```htmlThis is
``` The `
a paragraph
with line breaks.
` tag is an empty tag, which means that it has no end tag. [S1] **The HTML `` Element** The HTML `` element defines preformatted text. The text inside a `` element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks: [S1] ```htmlMy Bonnie lies over the ocean. My Bonnie lies over the sea.``` **HTML Horizontal Rules** The `
` tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule. The `
` element is used to separate content (or define a change) in an HTML page. The `
` tag is an empty tag, which means that it has no end tag. [S1] **Tag reference** | Tag | Description | |---|---| | `` | Defines a paragraph | | `
` | Defines a thematic change in the content | | `
` | Inserts a single line break | | `` | Defines pre-formatted text | ## π οΈ μ μ© μ¬λ‘ (Applied in summary) The poem inside `` shows when preformatting is needed (preserving the layout of verse), while `
` and `
` show how to control breaks within and between content blocks. No external project/commit applications found in the source. ## π» μ½λ ν¨ν΄ (Code patterns) Two paragraphs (HTML): ```htmlThis is a paragraph.
This is another paragraph.
``` Line breaks within a paragraph: ```htmlThis is
``` Preformatted text: ```html
a paragraph
with line breaks.My Bonnie lies over the ocean. My Bonnie lies over the sea.``` ## βοΈ λͺ¨μ λ° μ λ°μ΄νΈ (Contradictions & updates) A common beginner expectation is corrected here: extra spaces and blank lines in the HTML source do NOT affect the rendered output β the browser collapses them. Use `
`, ``, or CSS for intended spacing. [S1] ## β κ²μ¦ μν λ° μ λ’°λ - **μν:** draft - **κ²μ¦ λ¨κ³:** conceptual (μ€μ μ μ© μ¬λ‘ λ°κ²¬ μ applied/validatedλ‘ μΉκ²© κ°λ₯) - **μΆμ² μ λ’°λ:** B (W3Schools β widely used educational reference, not a primary standards body) - **μ λ’° μ μ:** 0.90 - **μ€λ³΅ κ²μ¬ κ²°κ³Ό:** μ κ· μμ± (New discovery) ## π μ§μ κ·Έλν (Knowledge Graph) - **μμ/루νΈ:** [[HTML Tutorial]] - **κ΄λ ¨ κ°λ :** [[HTML Headings]], [[HTML Basic]], [[HTML Formatting]], [[HTML Elements]] - **μ°Έμ‘° λ§₯λ½:** Referenced whenever laying out body text, breaks, and preformatted blocks on a page. ## π μΆμ² (Sources) - [S1] W3Schools β HTML Paragraphs β https://www.w3schools.com/html/html_paragraphs.asp ## π λ³κ²½ μ΄λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "HTML Paragraphs" page (Astra wiki-curation, P-Reinforce v3.1 format).