HTML Heading Tag

HTML tags are the fundamental elements of HTML used for defining the structure of the document. Most HTML tags come in pairs, consisting of an opening tag <>and a closing tag</> . The opening tag marks the beginning of an element, while the closing tag, which includes a forward slash before the tag name, indicates the end of that element.

Heading tag

Heading tags are used to define headings of douments. You can use different sizes for your headings. HTML also has six levels of headings, which use the elements <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.Where H1 is a largest heading and H6 is the smallest.All the heading tag is closed with</H1>…………</H6>. followed by their element.

<body>
   <h1>This is heading 1</h1>
   <h2>This is heading 2</h2>
   <h3>This is heading 3</h3>
   <h4>This is heading 4</h4>
   <h5>This is heading 5</h5>
   <h5>This is heading 6</h5>
</body>



Here is the Output:

This is heading 1

This is heading 2

This is heading 3

This is heading 4

This is heading 5
This is heading 6

 

Heading using CSS properties

In this example, we will use CSS font-size and font-weight property to make a headeing element from a paragraph element.

<!DOCTYPE html>
<html>
<head>
    <style>
    p{
        font-size: 24px;
        font-weight: bold;
    }
    </style>
</head>
<body>
    <p>Codespeedy</p>
    <p>Html heading tag using CSS</p>
</body>

</html>
 Here is the Output:

Codespeedy

Html heading tag using CSS

Leave a Comment

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

Scroll to Top