What Is a P Tag/Element

Q

What Is a P Tag/Element? - XHTML 1.0 Tutorials - Body Tag and Block Level Tags

✍: FYIcenter.com

A

A p element is a block level element that can be used directly as a sub-element in the body element. You can use p elements to specify paragraphs of text and in-line elements. Here are basic rules about p elements:

  • "p" elements are mixed content elements.
  • "p" elements can have empty contents.
  • "p" elements can have PCDATA as contents.
  • "p" elements can have in-line elements as contents.
  • "p" elements can not have block elements as contents.
  • "p" elements can not have "p" elements as contents.
  • "p" elements are block elements. They can not be used as in-line elements.
  • "p" elements will be displayed by browsers as paragraphs with some leading and trailing vertical spaces.

Here is a good example of p elements:

  <p>Learning XHTML is like learning any new language,
  computer or human. Most students first immerse themselves
  in examples. Studying others is a natural way to learn,
  making learning easy and fun.</p>

2007-05-12, 4730👍, 0💬