Text

Adding text to a web page is very easy. Text basically falls into one of three categories: paragraphs, headings, and quotes.

Paragraphs

Paragraphs are contained within <p> and </p> tags:

<p>This is a paragraph.</p>

Headings

You can have multiple levels of headings on a page. On this page, for example, the highest level heading is at the top of the page, and other headings like the one above this paragraph are sub-headings of that. Top-level headings are contained within <h1> and </h1> tags. Second-level headings are contained within <h2> and </h2> tags, and so on through the various levels up to level 6.

<h1>This is a Top-Level Heading</h1>
<h2>This is a Second-Level Heading</h2>
...
<h6>This is a Sixth-Level Heading</h6>

Quotes

You can use the <q> and </q> tags to include short quotes, and the <blockquote> and </blockquote> tags to include longer ones.

<p>This is a paragraph with a <q>short quotation</q>
embedded in it.</p>
<blockquote>
<p>And this is a longer quotation,
Which spans multiple lines.
</p>
</blockquote>

Notice that <blockquote> doesn't include the text directly - rather it contains a paragraph which in turn contains the text. The <blockquote> element is only supposed to contain block-level elements (such as paragraphs), not just plain text.

<-- Previous Page

CSS Precedence

Next Page -->

Formatting Text