Html tags part 2- headings,paragraph,formatting

    Tags which is used to display various types of heading, paragraphes and text formats like bold,italic are  explained with some examples.

 <h1>,<h2>,<h3>,<h4>,<h5>,<h6> tags

   These are used to display the heading in differnet sytles. Starting from h1 to h6, the size is decreased.

<!DOCTYPE html>

<html>

<head> Sample program</head>

<body>

<h1> Welcome </h1>

<h2> Welcome </h2>

<h3> Welcome </h3>

<h4> Welcome</h4>

<h5> Welcome </h5>

<h6> Welcome </h6>

</body>

</html>

output will be

   Sample program

 Welcome

 Welcome

 Welcome

 Welcome

 Welcome

 Welcome

Next, for displaying paragraph, <p> tag is used.

<p> tag:

     Do you want to insert a set of words, passages and paragraphs in a page . If your answer yes,use this paragraph tag.

<html>

<head> This is a sample html program </html>

<body>

<p> This is a sample paragraph. You can see in the browser window. You can add many lines in the paragraph

</p>

</body>

</html>

Tags used in paragraph:

When the user want to make the text in italic format, <i> tag is used. Alternatively, ,<b> tag is used to make the text to be displayed in BOLD size.

When you want to break the line,just use <br> tag.

Sample code is given below…

<html>

<head> This is a sample html program to display a paragraph </head>

<body>

<p>This paragraph has many texts with various formats. <br>

<b>Some texts are bold </b><br>

<i> Some texts are italic </i><br>

Some are normal in size

</body>

</html>


 The ouput will be...

This is a sample html program to display a paragraph 

This paragraph has many texts with various formats. 

Some texts are bold 

Some texts are italic 

Some are normal in size

These tags are generally used in document body.



No comments:

Post a Comment