MF Web Services logo

HTML Help & Resources

Paragraphs

The P tag defines a paragraph of text, and as such, is useful for search engines to determine relevance, knowing the content is defined as text.

A common mistake by designers is to place text inside DIV, SPAN, or TABLE containers without any contextual representation, such as P or H2 for example. When context is omitted, search engines could downgrade the relevance of text, based on where and how the text appears inside a document.

Paragraphs can be displayed in various different visual formats, using CSS. For more information about using CSS with paragraphs, visit our CSS reference instead.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
  <HEAD>
    <TITLE>Document Title</TITLE>
    ... META DATA ...
  </HEAD>
  <BODY>
  <!-- This works as intended -->
  <P CLASS="normal">This is a <SPAN>paragraph</SPAN> of text.</P>
  <!-- This might not work as intended -->
  <P CLASS="normal">This is a <H2>paragraph</H2> of text.</P>
  </BODY>
</HTML>

Paragraphs can not house any block-level elements, only items that are, or can be, defined as inline. A list below describes what can be held inside a P tag.

A listing of available inline elements is below. Items with an *asterisk identifies elements that can be defined as inline, but by default, are block level. It's important to note, the P tag cannot contain any block-level elements, or have members defined as block-level, which includes any tag defined inside the element. An example below.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
  <HEAD>
    <TITLE>Document Title</TITLE>
    ... META DATA ...
  </HEAD>
  <BODY>
  <!-- This works as intended -->
  <P CLASS="normal">This is a <SPAN>paragraph</SPAN> of text.</P>
  <!-- This might not work as intended -->
  <P CLASS="normal">This is a <SPAN STYLE="display:block;">paragraph</SPAN> of text.</P>
  </BODY>
</HTML>

Paragraphs can not house any block-level elements, only items that are, or can be, defined as inline. A list below describes what can be held inside a P tag.

  • <A>
  • <B>
  • <BR>
  • <CODE>
  • <EM>
  • <FONT>
  • <I>
  • <IMG>
  • <INPUT>
  • <LABEL>
  • <SELECT>
  • <SMALL>
  • <SPAN>
  • <STRONG>
  • <TEXTAREA>
  • <TT>
  • <U>
  • *<BUTTON>
  • *<IFRAME>
  • *<MAP>
  • *<OBJECT>
  • *<SCRIPT>

Move on to the Next Topic - DIV Block Level Containers.