Instagram
youtube
Facebook
Twitter

Introduction to HTML

What is HTML?

HTML (HyperText Markup Language) is the standard language used to create web pages. It provides the basic structure of a webpage, which is then enhanced by CSS (Cascading Style Sheets) and JavaScript.


Why is HTML Important?

  • It is the foundation of all websites.

  • It structures web content using tags and elements.

  • It helps in embedding images, videos, and links.

  • It works in all web browsers.


How Does HTML Work?

HTML consists of tags that define elements on a webpage. A simple HTML document looks like this:

<!DOCTYPE html>
<html>
<head>
    <title>My First Webpage</title>
</head>
<body>
    <h1>Welcome to HTML</h1>
    <p>This is my first HTML page!</p>
</body>
</html>
  • <!DOCTYPE html> → Defines the document type (HTML5).

  • <html> → The root element of an HTML page.

  • <head> → Contains metadata like title and links.

  • <body> → Contains visible content of the page.

  • <h1>, <p> → Heading and paragraph elements.


Key Features of HTML

  •  Easy to Learn – Simple syntax for beginners.
  •  Platform Independent – Works on any device.
  •  SEO-Friendly – Helps search engines understand content.
  •  Multimedia Support – Can embed images, videos, and audio.

Common HTML Tags & Their Uses

Tag Description

<h1> to <h6>

Headings (from largest to smallest)

<p>

Paragraphs

<a href="">

Hyperlinks

<img src="" alt="">

Images

<ul>, <ol>, <li>

Lists (unordered & ordered)

<table>

Tables

<div>

Container for styling & layout


How to View an HTML File?

  1. Create a file – Save it as index.html.

  2. Open in a browser – Double-click or use a code editor like VS Code.