A paragraph is a sentence or group of sentences referring to the same topic. Anything between the <
p> and </
p> tags will be considered as a paragraph by the browser.
<p>This is a paragraph</p> <p>This is another paragraph</p>
<p> is a block-level element, the Browsers automatically add blank lines before and after paragraphs.
Don't forget the closing tag
Even if you forget to use the closing tag, most browsers will display the HTML correctly:
<p>This is a paragraph <p>This is another paragraph
The above example will work fine in most browsers, but don't rely on this practice. Forgetting to use closing tags can produce unexpected results and errors.
If you want a line break (new line) without generating a new paragraph, use the <br /> tag:
<p>This is<br />a para<br />graph with line breaks</p>
The <br /> is a self closing tag and doesn't need another closing tag.
<br> or <br />
You may find that <br> is very similar to <br />.
In XHTML, XML, and future versions of HTML, HTML elements without closing tags (closing tags) are not allowed.
Even if <br> displays fine in all browsers, using <br /> is a longer-term guarantee.
HTML output - useful hints
We cannot be sure of the exact effect of the HTML being displayed. The size of the screen, and the resizing of the window can all lead to different results.
For HTML, you cannot alter the output by adding extra spaces or line breaks to the HTML code.
When the page is displayed, the browser removes extra spaces and blank lines from the source code.
Note that all consecutive blank lines (newlines) in the HTML code are also displayed as a single space.
Tip: To remember the name of this HTML element:
<p> comes from the word paragraph//= htmlentities($post["body"]); ?>