Create Free Websites
Create a Free Website at Ucoz
GrrooP.com
Jimdo.comSign Up
MoonFruit


Create Your Own
Designs

Without Tables

Artisteer - Web Design Generator

Use your knowledge of HTML to turn your template into a website.

Download a FREE Trial

HTML Code Tutorial

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 this HTML editor.



Take a quiz. Take a Quiz on this Information.