HTML5 > Elements of HTML

Headings in HTML5

How to create headings in HTML


Headings 

Headings are used as titles and subtitles. . The headings are used to auto format the text in to the heading. There are six type of headings in html they are <h1>, <h2>, <h3>, <h4>, <h5>, <h6>. Headings are used to display the document structure. .

NOTE:

Headings are used mainly as the headings in paragraph.

These must be used only as headings not as Big or bold 

  • <h1>-Main heading
  • <h6>-Least  heading
<h1>DOTNETFUNDA</h1>
<h2>TECHFUNDA</h2>
<h3>ITFUNDA</h3>
<h4>KIDSFUNDA</h4>
<h5>FARMINGFUNDA</h5>
<h6>FUNDOOVIDEO</h6>

In the above code snippet we used <h1> tags for headings, the auto format of headings decreases from h1 to h6.

output

Headings with colors:

We can add the colors to the following headings tag by using style attribute.

  
<p><i>Headings with colors </i></p>
    <h1 style="color:blue;">DOTNETFUNDA</h1>
    <h2 style="color:pink;">TECHFUNDA</h2>
    <h3 style="color:green;">ITFUNDA</h3>
    <h4 style="color:red;">KIDSFUNDA</h4>
    <h5 style="color:limegreen;">FARMINGFUNDA</h5>
    <h6 style="color:orange;">FUNDOOVIDEO</h6>

Headings with colors

In the above code snippet we have defined how to add colors to the headings. we have <p> and <i>  tag for displaying the text in the italic format and we are having heading tags from <h1> - <h6>, We are giving the style tag to <h1> to <h6> with different colors and displays the different colors of text in the output

output

 

 Views: 4941 | Post Order: 8



Write for us






Hosting Recommendations