24/04/2011

What are the basic HTML tags?

The most important tags in HTML are tags that define paragraphs ,line break and headlines.
Paragraph tag
Paragraphs are defined with th <p> tag
<p> this is a paragraph </p>
<p> This a new paragraph</p>
HTML automatically adds an extra blank line before and after a paragraph.

Headings
Headings are defined with the <h1> to <h6>tags where <h1> defines the largest heading. <h6> defines the smallest heading.
<h1> This is a heading</h1>
<h2> This is a heading</h2>
<h3> This is a heading</h3>
<h4> This is a heading</h4>
<h5> This is a heading</h6>
<h6> This is a heading</h6>
HTML automatically adds an extra blank line before and after a heading.
Line Breaks
The <br> tag is used when you want to end a line, but don't want to start a new paragraph. the <br> tag forces a line break wherever you place it.
<p> this <br> is a new para<br> graph with line break </p>
The <br> tag is empty tag. it has no closing tag.

Comments in HTML
the comment tag is used to insert a comment in HTML source code. A comments will be ignored by the browser. It can be used to give an explanation to the used code which can be helpful at the time of editing.
<!-- this is a comment-->
To conclude the topic the basic HTML tags are
<html>                   -    Defines an HTML documents
<body>                  -    Defines the document's body.
<h1> to <h6>       -    Defines header 1 to header 6.
<p>                        -    Defines paragraph
<br>                      -    Insert a single line break.
<hr>                      -    Defines a horizontal rule
<!-->                     -    Defines a comment