HTML provides six levels of headings. Usage of these headings helps us in ensuring a uniform look and feel for the document. We can format our pages with different levels of header tags. Various levels of headings are H1, H2 .... H6.
<H1> ... </H1>:
This is the first level of heading offered by HTML. This heading is most important when compared to other levels and this heading is the highest - level of headings. This tag inserts a line break before and after the text enclosed with in these two tags.
<H2> ... </H2>:
This is the second level of heading provided by HTML.
<H3> ... </H3>:
This is the third level of heading provided by HTML.
<H4> ... </H4>:
This is the forth level of heading provided by HTML.
<H5> ... </H5>:
This is the fifth level of heading provided by HTML.
<H6> ... </H6>:
This is the sixth level of heading provided by HTML.
Note: H1 tag is mainly used for main headings and mostly it is used once in a page. H2 to H6 can be used as many times as required.
A line space automatically is inserted before and after a heading (that is, an entire line is skipped between a heading and any text before and after it).
Code:
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
Output of the code:
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Bold tag in html is used to highlight marked portion of the text in bold. Bold tag differentiates the marked area from the rest.
Bold tag have one starting <b> tag and one ending </b> tag.
Code:
<b>This text is bold.</b>
Output of the code:
This text is bold.
We can display text in italic format with an html page by using <i> tag. Inside a webpage the area we want to be italic should be within one starting and one ending italic tag.
Italic text has different uses at different places. Within the body of the page we can mark some special type of text in italic to say they are different than normal text. In this site we used italic text to declare a variable or a function of the script.
Code:
<i>This text is italicised.</i>
Output of the code: This text is italicised.
This tag will underlines the text inside the tag.
Code:
<u>Underlined Text</u>
Output of the code:
Underlined Text
Line breaks in html pages can be given by using <br> tag.It does not have any end tags and it can be used at any place within the body tags of the page.
Code:
<p>Here is a...<br />line break.</p>
Output of the code:
Here is a
line break.
Code:
Here's a horizontal rule... <hr /> ...that was a horizontal rule :)
Output of the code:
Here's a horizontal rule...
...that was a horizontal rule :)
- Dotted
- Numbered
Unordered (Unnumbered) List
Unordered lists are also referred to as Bulleted Lists. Unnumbered lists are started with the <ul> tag, followed by the actual list items, which are marked with <li> tag. The list is ended with the ending tag </ul>
Code:
Output of the code:
* List item 1
* List item 2
* List item 3
Ordered lists are also referred to as Numbered Lists. Note, that the only difference between an ordered list and an unordered list is the first letter of the list definition ("o" for ordered, "u" for unordered).
Code:
<ol>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ol>
Output of the code:
1. List item 1
2. List item 2
3. List item 3
This tag is used to change the format of the text in the web page. This tag has two important attributes:
- face: The type of font used for the text. Common ones include "Time New Roman", "Verdana", and "Helvetica."
- size: This indicates the size of the text. Size can be absolute or relative.
- color: This indicates the color of the text. Either the color name or the six-character color code may be used to specify color.
- Paragraph
Code:
- Strong
- An alternative to Bold tag.
- Strike Through
- Used for striking through the text.
Code:
<basefont face="cursive, serif" color="#ff9900" size="4"/>
Makes text smaller, usually by one size below the default, or the BASEFONT, if specified:
Makes text bigger, usually by one size above the default, or the BASEFONT, if specified:
Code:
<big>Text which is in big font</big>
Output of the code:
Text which is in big font
You can center text, images and headings with the center tag.
Code:
<center>This is a centered sentence</center>
Output of the code:
Superscript text appears half a character above the baseline.
Code:
2<sup>3</sup>
Output of the code:
23
Code:
H<sub>2</sub>O
Output of the code:
H2O.
Code:
<blockquote>
<p>Here is a long quotation</p>
</blockquote>
Output:
Here is a long quotationThe HTML blockquote element may contain other block elements such as headers, paragraphs, preformat blocks and tables.