HTML CSS JAVASCRIPT PYTHON JAVA PHP BOOTSTRAP

HTML Basic

HTML Basics covers the fundamental building blocks of a web page. In this section, you will learn how an HTML document is structured and which tags are commonly used to create content.

HTML Document Structure

Every HTML document follows a basic structure. This structure helps the browser understand how to display the content correctly.

Example
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>

<h1>Hello World</h1>
<p>This is my first HTML page.</p>

</body>
</html>
Try this code

Explanation of the Code

HTML Headings

HTML headings are used to define titles and subtitles on a web page. There are six levels of headings, from <h1> to <h6>.

Example
<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Smaller Heading</h3>
Try this code

HTML Paragraphs

The <p> tag is used to define paragraphs. Browsers automatically add space before and after each paragraph.

Example
<p>This is a paragraph</p>
<p>This is another paragraph</p>
Try this code

HTML Line Break

The <br> tag is used to insert a line break. It is an empty tag and does not have a closing tag.

Common HTML Tags

<h1> – <h6> Defines headings
<p> Defines a paragraph
<br> Inserts a line break
<a> Defines a hyperlink

HTML Comments

HTML comments are not displayed in the browser. They are used to add notes in the code for developers.

<!-- This is an HTML comment -->

Why Learn HTML Basics?