HTML Basic Tags

In this tutorial you can learn basic HTML tags and how to use in HTML web pages.

Heading Tags

Any web pages start with heading. So, you required to display text as heading on web pages. HTML provide six type of heading tags like <h1>, <h2>, <h3>, <h4>, <h5>, <h6>. These tags are default padding and margin available which discuss later.

Heading Tags Example

<!DOCTYPE html>
<html>

   <head>
      <title>Heading Example</title>
   </head>

   <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>
      <h6>This is heading 6</h6>
   </body>

</html>

You can see above example code output as below

Paragraph Tag

The <p> tag is used to display text information in paragraphs. Each paragraph text between <p> and </p> tag.

Paragraph Tag Example Code

<!DOCTYPE html>
<html>

   <head>
      <title>Paragraph Example</title>
   </head>

   <body>
      <p>Here is a first paragraph of text.</p>
      <p>Here is a second paragraph of text.</p>
      <p>Here is a third paragraph of text.</p>
   </body>

</html>

You can see above example code output as below

Line Break Tag

The <br/> tag is used to break the line and start from the next line. This tag is also known as empty tag.

Line Break Tag Example Code

<!DOCTYPE html>
<html>

   <head>
      <title>Line Break  Example</title>
   </head>

   <body>
      <p>Hello<br />
         You delivered your assignment ontime.<br />
         Thanks<br />
         Mahnaz</p>
   </body>

</html>

You can see above example code output as below

Horizontal Lines

The <hr> tag is used to draw horizontal lines in the document. This tag creates a line from the current position in the document.

Horizontal Lines Example Code

<!DOCTYPE html>
<html>

   <head>
      <title>Horizontal Line Example</title>
   </head>

   <body>
      <p>This is paragraph one and should be on top</p>
      <hr />
      <p>This is paragraph two and should be at bottom</p>
   </body>

</html>

You can see above example code output as below