Skip to main content

Command Palette

Search for a command to run...

Html beginner

Updated
2 min read
Html beginner

what is Html

  • HTML stands for Hyper Text Markup Language

  • HTML is the standard markup language for creating Web pages

  • HTML describes the structure of a Web page

  • HTML consists of a series of elements

  • HTML elements tell the browser how to display the content

A Simple HTML Document

Example

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

HTML Element

The HTML element is everything from the start tag to the end tag:

<h1>My First Heading</h1>

<p>My first paragraph.</p>

Start tagElement contentEnd tag
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<br>nonenone

HTML Page Structure

<html>

<head>

<title>Page title</title>

</head>

<body>

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

<p>This is another paragraph.</p>

</body>

</html>

The <!DOCTYPE> Declaration

The <!DOCTYPE> the declaration represents the document type and helps browsers display web pages correctly.

It must only appear once, at the top of the page (before any HTML tags).

The <!DOCTYPE> the declaration is not case-sensitive.

The <!DOCTYPE> declaration for HTML5 is:

<!DOCTYPE html>

HTML Headings

HTML headings are defined with the <h1> to <h6> tags.

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 3</h4>
<h5>This is heading 3</h5>
<h6>This is heading 3</h6>

HTML Paragraphs

defined with the <p> tag:

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

HTML links are defined with the <a> tag:

<a href="https://github.com/Dhruv-Mali">click this link<a>

HTML images

This tag defines how to show <images> tag in the website:

<img src="1.jpg" alt="W3Schools.com" width="104" height="142">