Tuesday, April 26, 2011

HTML: Creating Heading by Tag


The <h>…</h> tag is used to create heading. This tag is the symbol of the Heading. There are 6 parameter used with this tag (h1, h2, h3, h4, h5, h6) to control the size of the heading. See the program:

Program

<html>
<head>
                <title>Astronomy</title>
</head>

<body>
                <h1>Introduction</h1>
                Astronomy, as a science, combines the best of new and old traditions.
</body>
</html>

 
Result



















Here, the <h1>…</h1> tag create the heading Introduction. Now see another program:

Program

<html>
<head>
            <title>Astronomy</title>
</head>
<body>
            <h1>Introduction</h1>
            <h2>Introduction</h2>
            <h3>Introduction</h3>
            <h4>Introduction</h4>
            <h5>Introduction</h5>
            <h6>Introduction</h6>
            Astronomy, as a science, combines the best of new and old traditions.
</body>
</html>

Result



















Heading Alignment

There are three attribute to keep the heading on the different side of a webpage. They are - left, center and right. The word align is needed to adjoin with these. See the program:

Program

<html>
<head>
            <title>Astronomy</title>
</head>

<body>
            <h1 align="left">Introduction</h1>
            <h1 align="center">Introduction</h1>
            <h1 align="right">Introduction</h1>
            <h1>Introduction</h1>
            Astronomy, as a science, combines the best of new and old traditions.
</body>
</html>


Result



















The left alignment is default.

No comments:

Post a Comment