|
|
HTML basics - HeadingsHeadings help in defining the format and structure of the document. They provide valuable tool in highlighting important topics and the nature of the document as a whole. There are six levels of headings in HTML specified by <H1>, <H2>, <H3>, <H4>, <H5> and <H6> tags. The outputs of these in a browser are as follows: <H1>I am heading 1</H1> gives:I am heading 1<H2>I am heading 2</H2> gives:I am heading 2<H3>I am heading 3</H3> gives:I am heading 3<H4>I am heading 4</H4> gives:I am heading 4<H5>I am heading 5</H5> gives:I am heading 5<H6>I am heading 6</H6> gives:I am heading 6As you can see, the heading tags come in pairs with the opening and closing tags. Any text surrounded by these tags will be displayed differently depending on the heading number. Let us make another HTML file. Open Notepad and type in the following text. Save this document as 'headings.html'. View it in your browser. <HTML> <HEAD> <TITLE>My fist HTML page with headings</TITLE> </HEAD> <BODY> <H1>I am heading 1</H1> <H2>I am heading 2</H2> <H3>I am heading 3</H3> <H4>I am heading 4</H4> <H5>I am heading 5</H5> <H6>I am heading 6</H6> </BODY> </HTML> Attributes <TAG ATTRIBUTE="VALUE">some text ... </TAG> Thus,
Note: Some attributes do not require a value part. All heading tags <H1> to <H6> have attributes. The important one are 'ALIGN' and 'TITLE'. The ALIGN attribute I am aligned to the left<H3 align="right">I am aligned to the right</H3> yields:I am aligned to the right<H3 align="center">I am centrally aligned</H3> yields:I am centrally alignedThe TITLE attribute Some Important Heading(If working in Internet Explorer, place your mouse cursor over the heading above to see how the TITLE attribute works.)Default values to attributes An important point Now play with the code:
Page contents: Html basics - headings in HTML - basics of HTML - HTML for beginner - heading tags in HTML
Page URL: http://www.webdevelopersnotes.com/tutorials/html/ html_basics_headings.php3
|
|