Text formatting in 


HTML


What is the Formatting?

Formatting refers to the arrangement of text in a desirable manner.

HTML provides different Tags to format the text of an Html page.

Some of these are as follows:-

  • Paragraph tag (i.e. <p> tag)

  • Line Break (i.e. <BR\> tag)

  • Headings

  • Draw Line

  • Center tag

  • Text Style (i.e. Bold, Italic, Underline, etc.)

Paragraph Tag OR <p> Tag

<p> tag represents paragraph of a Html page.

A blank line is always a separate paragraph when we use the <p> tag.

It is a paired tag and always present inside the <body> tag.

  Example:- <p> Hello!! This is a paragraph.</p>

Line Break or <BR\>

When text need to start from a new line 

Without skipping any line then we use <br> tag.

This tag simply jumps to a new line.

Example : <p> Name: Ram <br> Age:10</p>

Headings

Html provides 6 different types of headings.

 The highest level is <h1> and lowest is <h6>.

The text inside these tags appeared in bold.

Example:- <H1>hello!!</H1>

<H2>hello!!</H2>

<H3>hello!!</H3>

<H4>hello!!</H4>

<H5>hello!!</H5>

<H6>hello!!</H6>

Draw line

To draw a line <hr> tag is used.

This tag draws a horizontal line across the whole page.

Example:-

<h1>Html</h1><hr> 

Center Tag

<Center> tag is used to put everything inside it in the center.

It is also a paired tag.

Example:- <center><h1> Hello!!</h1> </center>

Text Style

<B> tag is used to display the text in bold.

ex:- <p><b>hi </b>good to see you</p>

<I> tag is used to display the text in Italic.

  ex:- <p><I>hi </I>good to see you</p>

<U> tag is used to display the text as underline.

ex:- <p>hi <u>good to see you</u></p>

<Q> tag is used to display the text in quotes.

ex:- <p><q>hi </q>good to see you</p>