Basic HTML
Learn the basic HTML building blocks used to create and structure web pages.
Introduction to Basic HTML
After understanding the fundamentals of HTML, the next step is to learn the basic elements used to build a web page.
HTML provides a collection of elements that allow developers to organize content such as headings, paragraphs, links, images, and other page components.
Simple HTML Example
<!DOCTYPE html>
<html>
<head>
<title>Basic HTML Example</title>
</head>
<body>
<h1>Welcome to CIIT Institute</h1>
<p>
Learn HTML step-by-step.
</p>
</body>
</html>
Output
Welcome to CIIT Institute
Learn HTML step-by-step.
HTML Elements
HTML elements are the basic building blocks of an HTML document. They describe the content and structure of the page.
<p>This is a paragraph.</p>
Opening Tag
<p> starts the paragraph element.
Content
The text between the tags is the element content.
Closing Tag
</p> ends the paragraph element.
HTML Attributes
Attributes provide additional information about an HTML element. They are normally written inside the opening tag.
<p id="intro">
Welcome to CIIT Institute.
</p>
attribute="value".
HTML Headings
HTML provides six heading levels from
<h1> to <h6>.
<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
Main Heading
Sub Heading
Heading 3
Heading 4
Heading 5
Heading 6
HTML Paragraphs
The <p> element is used to create
paragraphs.
<p>
HTML is easy to learn.
</p>
<p>
Start building your first web page.
</p>
HTML is easy to learn.
Start building your first web page.
HTML Comments
Comments are written inside the HTML source code and are ignored by the browser when displaying the page.
<!-- This is an HTML comment -->
<h1>Welcome to HTML</h1>
HTML Line Breaks
The <br> element is used to insert
a line break.
<p>
Hello<br>
Welcome to HTML<br>
Learn Web Development
</p>
Welcome to HTML
Learn Web Development
HTML Horizontal Rules
The <hr> element is used to create a
thematic horizontal separation between sections.
<h2>HTML</h2>
<p>
Learn HTML step-by-step.
</p>
<hr>
<h2>CSS</h2>
HTML
Learn HTML step-by-step.
CSS
Basic HTML Topics
HTML Elements
Understand the structure and types of HTML elements.
HTML Attributes
Learn how attributes provide additional information to elements.
Headings
Learn how to create and organize headings using HTML.
Paragraphs
Learn how to create paragraphs and organize text content.
Comments
Learn how to add comments to HTML source code.
Line Breaks
Learn how to move content to a new line.
Horizontal Rules
Learn how to visually separate sections of content.
Practice Exercise
-
Create an HTML file named
index.html. -
Add an
<h1>heading. - Add two paragraphs.
- Add an HTML comment.
-
Use a
<br>line break. -
Use an
<hr>between two sections.
Summary
In Basic HTML, you will work with the fundamental elements used to structure a web page. This module covers HTML elements, attributes, headings, paragraphs, comments, line breaks, and horizontal rules.