The <p> Tag

Paragraphs are use used as containers for raw text and inline elements. They cannot contain other paragraphs - or indeed, any other block element. The code for a paragraph element bears the form


<p>Text...Inline Element...Text...</p>

Like any other element, paragraphs are amenable to CSS styling. The more useful attributes of <p> elements are listed below

It is common practice to place raw text directly inside the body element. Browsers tend to be very fault tolerant and accept this. Nevertheless, this is wrong - raw text should always be wrapped in a <p>..</p> pair.

Finally, it should be noted that browsers ignore sequences of empty paragraph tags - as they do sequences of spaces and all carriage return characters.

Jump To...

Colophon