learn2kode.in

HTML Introduction

What is HTML?

HTML (HyperText Markup Language) is the standard markup language used to create web pages. It provides the structure of a website and tells the browser how to display content like text, images, links, and other elements.

Basic HTML Structure

A typical HTML page has the following structure: a declaration,root element,section for metadata, andsection for content.

Example Code

<!DOCTYPE html>
<html>
  <head>
    <title>My First Web Page</title>
  </head>
  <body>
    <h1>Welcome to Learn2Kode</h1>
    <p>This is my first HTML page!</p>
  </body>
</html>

Output

Welcome to Learn2Kode
This is my first HTML page!

HTML Document Outline

Every HTML document has a standard outline:

  • <!DOCTYPE html> – defines HTML version

  • <html> – root element

  • <head> – metadata, title, links to CSS/JS

  • <body> – visible content

Example Code

<!DOCTYPE html>
<html>
  <head>
    <title>Document Outline Example</title>
  </head>
  <body>
    <h1>HTML Outline</h1>
    <p>This is the body content</p>
  </body>
</html>

Output

HTML Outline
This is the body content

Tips for Beginners