Every HTML page follows the same basic structure. Learn it once and you can start any web page.
The parts of a page
<!DOCTYPE html>tells the browser this is a modern HTML5 page.<html lang="en">wraps the whole page. Thelangattribute helps search engines and screen readers.<head>holds information about the page: the title, character set and links to CSS files. It is not shown on the page.<body>holds everything the visitor sees: headings, text, images, links and forms.
Always add these two lines in the head
<meta charset="UTF-8">so Hindi, symbols and emojis display correctly.<meta name="viewport" content="width=device-width, initial-scale=1">so the page looks right on mobile phones.
Tip: Save this structure as a template file and start every new page from it.
Example
Example — A complete HTML page
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My First Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first web page.</p>
</body>
</html>
The title appears in the browser tab; the heading and paragraph appear on the page.
Try it Now »