1

HTML (HyperText Markup Language)

HTML is the standard language used to create and design web pages. It tells the browser how to display text, images, links, buttons, and other elements on a website.


1. What is HTML?

  • HTML stands for HyperText Markup Language.

  • It is used to structure a webpage.

  • HTML uses tags to define elements like headings, paragraphs, images, links, etc.

  • Every website you see is built using HTML.


2. Basic Structure of an HTML Document

 
<!DOCTYPE html> <html> <head> <title>My Web Page</title> </head> <body> <h1>Hello World</h1> <p>This is my first website.</p> </body> </html>

Explanation

  • <html> – Root of the webpage

  • <head> – Information about the page (title, metadata)

  • <body> – Everything visible on the screen


3. Common HTML Tags

✔ Headings

 
<h1>Heading 1</h1> <h2>Heading 2</h2>

✔ Paragraph

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

✔ Image

 
<img src="image.jpg" alt="My Image">

✔ Link

 
<a href="https://google.com">Go to Google</a>

✔ List

  • Ordered List

 
<ol> <li>Item One</li> <li>Item Two</li> </ol>
  • Unordered List

 
<ul> <li>Apple</li> <li>Banana</li> </ul>

4. Attributes

Attributes provide extra information to a tag.
Example:

 
<img src="photo.jpg" width="200" height="200">

src, width, height → attributes.


5. HTML Comments

Used for notes inside code:

 
<!-- This is a comment -->

6. Why HTML is Important?

  • Base of every website

  • Simple and beginner-friendly

  • Works with CSS & JavaScript

  • Used in frontend development