19 Like(s)
|
Paragraphs are the most rudimentary elements of a text document. You indicate a paragraph with the p element by inserting an opening p tag at the beginning of the paragraph and a closing p tag after it, as shown in this example.
This is some text in a paragraph.
Visual browsers nearly always display paragraphs on new lines with a bit of space between them by default (to use a term from CSS, they are displayed as a block). Paragraphs may contain text, images, and other inline elements (called phrasing content in the spec), but they may not contain headings, lists, sectioning elements, or any element that typically displays as a block by default. In HTML, it is OK to omit the closing /p tag.
A browser just assumes it is closed when it encounters the next block element. However, in the stricter XHTML syntax, the closing tag is required (no surprise there). Many web developers, including myself, prefer to close paragraphs and all elements, even in HTML, for the sake of consistency and clarity. I recommend folks who are just learning mark-up, like yourself, do the same.
Categories: HTML5
Leave a comment