HTML Code Tutorial

Tutor Ebook Download

The Paragraph Tag

The paragraph tag <p></p> is used to place paragraphs in your pages. For future xhtml compliance, you should always use a closing tag. </p>

Setting Paragraph Attributes

Attributes for paragraphs can be set using embedded, linked or inline style sheets.

p { font-family: Arial , sans-serif;font-size : 10pt; font-weight : normal;text-align :left; text-indent : 1em}

This style sheet would set our paragraph text to 10 point Arial, set alignment of text to the left and indent the paragraph 1 em.

You can also set the color of text, weight of text, style of text, line spacing, width and add left, right, top and bottom padding.

Using Inline Style Sheets

The appearance of text within a paragraph can be changed using inline style sheets. The <b></b> bold tag used in previous versions of HTML is a deprecated tag and will not be included in future HTML versions.

The span tag <span></span> is a useful tool for changing font appearance within a paragraph. The span tag should only be used as an inline tag.

This code would produce the results shown here, when using the span tag to change the weight of text to bold.

<p>This code would produce <span STYLE="font-weight : bold">the results shown here</span>, when using the span tag to change the weight of text to bold.</p>

It could also be used to change the color of the text.

<p>It could also be used to change the <span STYLE="color :#FF0000;background-color :#FFFFFF">color</span> of the text.</p>

Other inline tags that can be used to change text within a paragraph are:

  • <em></em> This is emphasized text.

  • <strong></strong> This is ,strong text.

  • <sub></sub> This is subscript text.

  • <sup></sup> This is superscript text.



You can Test Code in : HTML editor

Take a quiz. Take a Quiz on this Information.



CGI Online
How to Create a Website -Tutorial
Main Website


This Free HTML Tutorial
is provided by Net Success 2000 Plus Inc.
PO Box 1508
Somerset, KY 42502
Last Modified: September 3, 2007

HTML Codes Tutor Ebook