Course Content
HTML Introduction
0/1
HTML Editors
0/1
HTML Basic Tags
0/1
HTML Elements
0/1
HTML Attributes
0/1
HTML Headings
0/1
HTML Paragraph
0/1
HTML Text Formatting
0/1
HTML Meta Tags
0/1
HTML Quotations
0/1
HTML Comments
0/1
HTML Images
0/1
HTML Background
0/1
HTML Colors
0/1
HTML Lists
0/1
HTML Tables
0/1
HTML Forms
0/1
HTML Spell Check
0/1
HTML Media
0/1
HTML Marquees
0/1
HTML CSS
0/1
HTML Links
0/1
HTML Block & Inline
0/1
HTML Classes
0/1
HTML Id
0/1
HTML I frames
0/1
HTML Java script
0/1
HTML File paths
0/1
HTML Layout
0/1
HTML Responsive
0/1
HTML Computer Code
0/1
HTML Tutorial
About Lesson

HTML Basic Tags

In this tutorial, we will learn about the basic tags in HTML with the help of examples.


Basic Tags

HTML consist of a series of tags/elements that we must consider and include while starting to code. These elements/tags tell the browser how to display the content on web-pages.


Basic HTML Document

MY first program :-

<!DOCTYPE html>
<html>
  <head>
    <title>Hello!</title>
  </head>
  <body>
    <h1>This is simple heading.</h1>
    <br>
    <p>This is a simple paragraph.</p>
    <hr>
  </body>
</html>

Explanation of tag used in above example

Tags Description
<!DOCTYPE html> Every HTML document start with a HTML document tag. It informs the web browsers about the type and version of HTML used in the document. It is not mandatory but it is good practice to start with this tag. It is not case-insensitive.
<html> Every HTML document must be enclosed between basic HTML tags.it start with <html> tag and ends with </html> tag.
<head> the head tag comes after the tag and contains all the headings of the document/webpage.it also contain title, metadata, links and so on.it start with <head> tag and ends with </head> tag.
<title> This tag represents the title of the page which will be displayed on the tab/windows bar of the browser. this tag contains the header information and mentioned within the <head> tag. It start with <title> tag and ends with </title> tag.
<body> This is the most important of all tags. Every content written within this tag will be displayed on the webpage and contains all the visible or audible content.(like tables, paragraphs, links, images, lists, etc.) this tag starts with <body> and ends with </body> tag.
<h1> This tag defines the large heading. This tag start with <h1> and ends with </h1>.
<br> This tag defines the break. this tag start with <br> and ends with </br>.
<p> This tag defines the paragraph. This tag start with <p> and ends with </p>.
<hr> This tag defines the horizontal line. this tag start with <hr> and ends with </hr>.

Headings

There are six levels of headings are defined in HTML (<h1> to <h6> ).

<h1>It is the most important/Largest heading.</h1>
<h6>It is the least important/smallest heading.</h6>

Output

It is the most important/Largest heading.

 

It is the least important/smallest heading.


Paragraphs

The <p> tag help us to write paragraphs in a webpage.

<p>This is first paragraph.</p>
<p>This is last paragraph.</p>

Output

This is first paragraph.

This is last paragraph.


Horizontal Line

The <hr> tag used to display horizontal line in a webpage. this tag does not have any closing tag.

<p>This is first paragraph.</p>
<hr>
<p>This is last paragraph.</p>

Output

This is first paragraph.


This is last paragraph.


Types of Tag in HTML

Tags Description
Paired Tags Tags that have both opening and closing tags are known as paired tags. (like – <p></p>, <head></head> etc.)
Singular/Void Tags Tags that don’t have a closing tag or any contents. These tags are known as void tags. Void tags include <img> tag, <meta> tag, <link> tag, and <input> tag, <hr> tag.

 

Exercise Files
No Attachment Found
No Attachment Found
error: Content is protected !!