🌐 Introduction to HTML

Last Updated: 01 Nov 2025

  • HTML (HyperText Markup Language) is the standard language used to create web pages. It defines the structure and meaning of web content using tags.
  • Markup languages are used to describe the structure and content of web pages, such as headings, paragraphs, links, images, etc.
  • HTML is a lightweight markup language that is easy to learn and use.
  • It is first introduced in the 1990s by Tim Berners-Lee, the inventor of the World Wide Web.

🗣 Hinglish Tip: HTML ek markup language hai — programming language nahi. Ye batata hai content ka structure (headings, paragraphs, images, etc.)


History of HTML

VersionYearKey Features
HTML 1.01991Basic text & links only
HTML 2.01995Forms and basic structure
HTML 3.21997Tables, applets, scripting
HTML 4.011999CSS integration, better structure
HTML52014Audio, video, canvas, semantic tags

🗣 Hinglish Tip: Ab sab modern websites HTML5 par based hoti hain — mobile-friendly aur multimedia support ke sath.


🏗️ Basic Structure of an HTML Document

Every HTML file starts with this structure 👇

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Page Title</title>
    <!-- Your More head content goes here -->
  </head>
  <body>
    <!-- Your content goes here -->
  </body>
</html>

Explanation

  • <!DOCTYPE html> → Tells browser to use HTML5 version
  • <html> → Root element (wraps everything)
  • <head> → Metadata like title, charset, etc.
  • <title> → Page title
  • <body> → All visible content appears here

🏷 Understanding HTML Tags

  • Tags are like containers that hold content and attributes.
  • HTML tags written inside angle brackets < >.
  • Tag Name are not case-sensitive.
  • You are allowed to have multiple tags inside each other.
  • Tag are two types:
    • Paired tags
    <tagname>Content</tagname>
    

    🗣 Hinglish Tip: Hamesha tag ko close karna mat bhoolo! Browser galat layout dikha sakta hai agar closing tag miss ho gaya.

    • Self-closing tags
    <tagname />
    

    🗣 Hinglish Tip: Self-closing tag ke andar kabhi bhi content nahi aata — bas attributes likhte hain.


🔗 Attributes in HTML

Attributes provide extra information to elements.They are written inside the opening tag.

<tagname attributeName="value"> </tagname>

<tagname attributeName="value" />

Html Comments

  • HTML comments are used to add notes or instructions to the HTML code.
  • They are not visible to the user and are not rendered on the page.
<!-- This is a comment -->