DEV Community

Boomika N
Boomika N

Posted on • Edited on

Introduction to HTML Basics

1.What is HTML?
HTML stands for Hyper Text Markup Language. It is used to create web pages and structure content on the internet.
Every website we see is built using HTML.

2.What is <DOCTYPE html> and why do we use it?
<DOCTYPE html>is written at the top of every HTML document.

*why do we use it:
It tells the browser that this document is written in HTML5
It helps the browser display the page correctly
It avoids compatibility issues
It is not a tag it is a declaration
Example:
HTML
<DOCTYPE html>
<html>
</html>

What is <head> tag?

The <head>tag contains information about the webpage.
It includes:
title
Meta data
Links to CSS
Scripts
The content inside

is not directly visible on the webpage.
Example:
HTML
<head>
<title>My First page</title>
</head>
Enter fullscreen mode Exit fullscreen mode

3.What is <title>Tag?
The <title> tag is written inside the

tag.
Purpose:
It shows the page name in the browser tab
Example:
HTML
<title>HTML Basics</title>
It will appear on the browser tab as: HTML Basics
Enter fullscreen mode Exit fullscreen mode

4.What <body>Tag?
The <body> tag contains the main content of the webpage.
Everything inside

is visible to users.
Example:
HTML
<body>
<h1>Welcome</h1>
<p>This is my first htmlpage.</p>
<body>
Enter fullscreen mode Exit fullscreen mode

5.What is Block Elements?
Block elements start on a new line, it takes full width of the page
Example:

<div>
<p>
<h1>to<h6>
Enter fullscreen mode Exit fullscreen mode

6.What is <div> Tag?
<div> means division
It is used to group elements together
Think of it like a container or box that holds other elements.
Example:
HTML

<div>
<h1>Welcome</h1>
<p>This is inside a div.</p>
</div>
Enter fullscreen mode Exit fullscreen mode

7.What is <p> Tag?
<p> means Paragraph
It is used to write text in paragraph form
Example:
HTML

<p>this is a Paragraph</p>
Enter fullscreen mode Exit fullscreen mode

It automatically starts on a new line
It is also a block element.

Top comments (0)