The <p> tag in HTML is used to delineate a paragraph, which inherently begins on a new line. Additionally, web browsers instinctively insert a margin both before and after a paragraph to create some white space.
<p>This is a paragraph.</p> <p>This is another paragraph.</p> |
The way HTML is displayed can vary.
Different screen sizes and window resizing can produce varying results.
In HTML, adding extra spaces or lines in your code will not change the display.
The browser will automatically remove any additional spaces and lines when rendering the page.
<p> This paragraph contains a lot of lines in the source code, but the browser ignores it. </p> <p> This paragraph contains a lot of spaces in the source code, but the browser ignores it. </p> |
The <hr> tag represents a thematic break in an HTML page and is typically displayed as a horizontal line.
The <hr> element is used to separate content or indicate a change in an HTML page.
<h1>This is heading 1</h1> <p>This is some text.</p> <hr> <h2>This is heading 2</h2> <p>This is some other text.</p> <hr> |
The <br>
tag in HTML is utilized to create a line break, allowing for a new line without the initiation of a new paragraph.
<p>This is<br>a paragraph<br>with line breaks.</p> |
Always remember a <br> tag is an empty tag and has no end tag.
This poem will be displayed on a single line:
<p> My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the ocean. Oh, bring back my Bonnie to me. </p> |
The <pre>
tag in HTML is used to indicate preformatted text, which is shown using a monospace font (typically Courier) and maintains the original spacing and line breaks.
<pre> |