Web Page Design: Block-level Markup 02

Paragraphs

As we have seen, we mark up paragraphs with the <P> start tag. The closing tag </P> is not required. Inside the document markup, whitespace is replaced by single spaces.

Line breaks may be forced using the BR element, which of course, uses the <BR> tag. If you want to prevent a line break at a particular point use the non-breaking space character entity: &nbsp;.

Here is an example of two short paragraphs showing line breaks and some preventive non-breaking spaces:
<p>There is no time<br>like the present.<br>Except for, maybe,<br>the past.<p>Summertime&nbsp;is&nbsp;my&nbsp;favorite&nbsp;time&nbsp;of&nbsp;the&nbsp;year,<Br>except when it rains.

This will be rendered like so:

There is no time
like the present.
Except for, maybe,
the past.

Summertime is my favorite time of the year,
except when it rains.

If you find that there are no breaks between paragraphs, that may sometimes be remedied by including the </P> end tag. Some browsers have rendering bugs that this fixes, but it is correct HTML to omit the P element end tag.


Go on to next segment Go to Contents