Fourth Chapter Lesson-6: Uses of Heading tags, Paragraph tags, Formatting tags and font tags.

At the end of this lesson-

  • 1. You will be able to explain the uses of different heading tags.
  • 2. You will be able to explain the use of paragraph tag.
  • 3. You will be able to explain the uses of different formatting tags.
  • 4. You will be able to define different properties of the fonts. 

 

Heading Tags: Any content or article starts having a nice heading, provides the headline or the topic name of any document.Similarly, in HTML code also, different sizes of heading can be given on your web page. HTML allows six sizes for heading that uses elements name in the format of <hn>, where n starts from 1 till 6; like this:

  • <h1> …</h1>
  • <h2> …</h2>
  • <h3> …</h3>
  • <h4> …</h4>
  • <h5> …</h5>
  • <h6> …</h6>

<h1> defines the most important heading. <h6> defines the least important heading.

Output of the above code:

 

 

 

 

 

 

 

 

Paragraph Tag: The HTML <p> element defines a paragraph. With HTML, you cannot change the output by adding extra spaces or extra lines in your HTML code. The browser will remove any extra spaces and extra lines when the page is displayed. Browsers automatically add some white space (a margin) before and after a paragraph.

Let’s see the following code:

Output of the above code:

This paragraph contains a lot of lines in the source code, but the browser ignores it. This paragraph contains a lot of spaces in the source code, but the browser ignores it.

 

HTML Text Formatting: Formatting is one of the crucial sections of every development. For making any project or article or content looks attractive, readable and user-intractable, formatting plays a very important role. Formatting can be defined as the appearance of your documentation or presentation of your HTML code in a meaningful and nicer way. Formatting is mainly done for making the layout attractable. Some formatting tags:

TagsUses
<small></small>For making texts small in size then the regular texts surrounded.
<big></big>For making texts bigger or larger then the rest of the texts surrounded.
<em></em>For emphasizing the texts.
<strong></strong>Used in those texts which are important and needs to highlight.
<b></b>For making the text Bold.
<i></i>For making the text italics.
<u></u>For making text underlined.
<del></del>To show texts that have been deleted or removed or replaced.
<strike></strike>For displaying any text as strike through.
<sub></sub>Defines subscripted text.
<sup></sup>Defines superscripted text.

The HTML <br> element defines a line break. In the following code <br> has been used for line break.

Let’s see the following code:

Output of the above code:

HTML code for displaying this (a+b)2=a2+2ab+b2  theory on the web page. 

 

Changing color, size and face of the text: Setting the style of an HTML element, can be done with the style attribute. The HTML style attribute has the following syntax:

<tagname style=”property:value;>

color property defines the text color for an HTML element, font-family property defines the font to be used for an HTML element and font-size property defines the text size for an HTML element. 

Let’s see the following code:

Output of the above code:

Color, size and face of the text can also be defined using <font> tag. Let’s see the following code:

 

Lesson Evaluation-

Knowledge Based Questions:

Comprehension Based Questions:

  • b. Explain the attributes of <font> tag.

Creative Questions:

Multiple Choice Questions:

 


Written by,

Leave a Reply

Your email address will not be published. Required fields are marked *