Techcss
Untitled Document

HTML Text Formatting

Displaying the HTML text in various format as the necessity of showing importance to viewer in a particular way needs some particular tags for coding like <b>,<u>,<i> etc.

Using the major text formatting tags - <b>, <i>, <u>, <sub>, <sup>elements

Example:

<p><b>This is bold styled text</b></p>
<p><strong>This text is important and so strong</strong></p>
<p><i> This text is styled as italic </i></p>
<p><em>This text is emphasized</em></p>
<p><u> This text is underlined </u></p>
<p>This <ins>part</ins> of text is inserted</p>
<p>The chemical formula of water is H<sub>2</sub>O (text<sub>subscripted</sub>)</p>
<p>x<sup>a</sup> . X<sup>b</sup> = X<sup>a+b</sup> </p>
<p><s>This text is cancelled and so striked through</s></p>
<p><del>This text is deleted but should displayed on screen as cancelled</del> </p>
<p><small>This text is resized as small </small></p>

Output:

This is bold styled text

This text is important and so strong

This text is styled as italic

This text is emphasized

This text is underlined

The chemical formula of water is H2O (textsubscripted)

xa . Xb = Xa+b (textsuperscripted)

This text is cancelled and so striked through

This text is deleted but should displayed on screen as cancelled

This text is resized as small


Preformatted text

The preformatted text is defined by <pre> tag and preserves the spaces and line breaks of contents.

Example:

<pre>
#include <stdio.h>

int main()
{
  int c, n, fact = 1;

  printf("Enter a number to calculate it's factorial\n");
  scanf("%d", &n);

    for (c = 1; c <= n; c++)
   {
      fact = fact * c;
    }

    printf("Factorial of %d = %d\n", n, fact);

return 0;
}
</pre>

Output:
    #include 
        
     int main()
     {
      int c, n, fact = 1;
        
      printf("Enter a number to calculate it's factorial\n");
      scanf("%d", &n);
        
      for (c = 1; c <= n; c++)
        {
        	fact = fact * c;
         }
        
       	 printf("Factorial of %d = %d\n", n, fact);
        
      return 0;
      }
    

<address> tag

The <address> tag is used to write the address or contact information of author or owner of the website.

Example:

<address>
All rights reserved to bengalgateway.com <br />
Web:<a href="http://bengalgateway.com" target="_blank">Visit us</a> <br />
Street Address: Belgachia, Kolkata-700037, India<br />
Phone: +91 33 1234 5678 <br />
</address>

Output:
All rights reserved to bengalgateway.com
Web:Visit us
Street Address: Belgachia, Kolkata-700037, India
Phone: +91 33 1234 5678