10 Stellar Web Resources for HTML5 and CSS3
How to Create Tables in HTML5
How to Design User-Friendly Forms in HTML5

How to Create Paragraphs in HTML5

Paragraphs appear more often than any other text block in web pages. Remember, though, that HTML browsers don’t recognize hard returns that you enter when you create your page inside an editor. You must use a <p> tag to tell the browser to package all text up to the next closing </p> tag as a paragraph.

To create a paragraph, follow these steps:

  1. Add <p> in the body of the document.

  2. Type the content of the paragraph.

  3. Add </p> to close that paragraph.

Here’s what it looks like:

<!DOCTYPE html>
    <meta charset="UTF-8">
    <title>All About Blocks</title>
    <p>This is a paragraph. It's a very simple structure that you will use
       time and again in your web pages.</p>
    <p>This is another paragraph. What could be simpler to create?</p>

This HTML page includes two paragraphs, each marked with a separate <p> element. Most web browsers add a line break and a full line of white space after every paragraph on your page, as shown in this figure.


Sloppy HTML coders don’t use the closing </p> tag when they create paragraphs. Although some browsers permit this dubious practice without yelling, omitting the closing tag isn’t good practice because it

  • Isn’t correct syntax.

  • Causes problems with style sheets.

  • Can cause a page to appear inconsistently from one browser to another.

You can control paragraph formatting (color, style, size, and alignment) with Cascading Style Sheets (CSS).

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
How to Use Check Boxes and Radio Buttons in Your HTML5 Form
How to Create Numbered Lists in HTML5
Manage Table Layouts in HTML5
Master HTML5 Video Markup
Different Versions of HTML5

Inside Dummies.com