HTML: Paragraph and Styles

Hyper Text Markup Language

HTML: Paragraph: Style Attribute:

<p> element defines a paragraph:

You can change the look of the paragraph by adding a style.
<p style=”property:value;“> = new look

Example of text having a blue color

<p style=”color:green;”>

Green Text

</p>


Examples of adding a style to your paragraph element:

Example of a color property

HTML Code

Result

<p>Text default</p>

<p style=”color:red;”>Text red</p>

<p style=”color:blue;”>Text blue</p>

<p style=”font-size:36px;”>Text bigger</p>

This is an email link:
Text default

Text red

Text blue

Text bigger


Example of a font-size property

HTML Code

Result

<p style=”font-family:verdana;”>

This is a heading</p>

<p style=”font-family:courier;”>

This is a paragraph.</p>

This is a paragraph.

 

This is a paragraph.


Example of a text-align property

HTML Code

Result

<p style=”text-align:center;”>Centered paragraph.</p>

<p style=”text-align:left;”>Left paragraph.</p>

<p style=”text-align:right;”>Right paragraph.</p>

 

Centered paragraph.

Left paragraph.

Right paragraph.

Leave a Reply