Creating Paragraphs and Line Breaks

Within the <body> section of the document, you type the text that will appear on the Web page. Each paragraph of text should be enclosed in a two-sided tag that indicates its type.

The most basic paragraph type is the body paragraph, indicated by the <p> tag. It is a two-sided tag, so the paragraph text is placed between a <p> and a </p>. In HTML the </p> can be omitted, but in XHTML it is required. Even if you are using HTML, it is good practice to always include the </p> tag, so you don’t get into any sloppy habits that will get you in trouble later if you decide to switch to XHTML.

When a Web page is displayed in a browser, white space is inserted between paragraphs:

That can be a problem when you don’t want ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.