HTML
What is HTML?
es
HTML (HyperText Markup Language) is the standard language for creating web
t
pages. It provides the structure of a webpage using various elements (tags).
o
Why is HTML Important?
N
● It defines the structure of a webpage.
● Browsers interpret HTML to display content.
● Works together with CSS (for styling) and JavaScript (for functionality).
Basic HTML Structure :
ta
up
G
sh
yu
Pi
<!DOCTYPE html> → Defines the document as an HTML5 document.
<html> → The root element of the page.
<head> → Contains metadata (title, styles, SEO info).
<body> → Contains the visible content of the webpage.
Basic HTML Elements
✅ Headings (<h1> to <h6>)
Used for defining headings. <h1> is the largest, <h6> is the smallest.
es
✅ Paragraphs (<p>) and Line Breaks (<br>) ot
N
✅ Links (<a href="">) ta
up
G
target="_blank" opens the link in a new tab.
✅ Lists (<ul>, <ol>, <li>)
sh
Unordered List (Bullets)
yu
Pi
Ordered List (Numbers)
es
✅ Images (<img>)
ot
N
ta
p
Forms and Inputs
u
G
sh
yu
Pi
required ensures the field must be filled before submission.
✅ action
Defines where the form data is sent (e.g., a backend script).
✅ method
● "GET" → Sends data in the URL (less secure, good for search queries).
es
ot
N
a
● "POST" → Sends data securely in the request body (used for login,
t
registration, etc.)
p
Input Types
✅ Text Inputs
u
G
sh
✅ Password Input
✅ iy
u
P
Email Input
✅ Number Input
✅ Telephone Input
✅ Date Input
s
e
✅ File Upload
ot
N
✅ Radio Buttons
a
t
✅ Checkboxes
up
G
h
s
✅ Dropdown
u
iy
P
✅ Textarea
Tables
es
ot
N
ta
up
G
<th> for table headings, <td> for table data.
sh
Media Elements
✅
yu
Audio
P i
✅ Video
What is <div>?
<div> stands for "division" and is used to group elements together.
It is a block-level element, meaning it takes up the full width of its container.
es
ot
N
The <div> groups the heading and paragraph together, making it easier to style.
What is id?
ta
up
id is used to uniquely identify an HTML element.
No two elements should have the same id.
G
Used for JavaScript interactions and specific CSS styling.
sh
yu
Pi
What is class?
class is used to apply the same style to
multiple elements.
Unlike id, multiple elements can have the
same class.
Semantic Tags
Semantic HTML means using HTML tags that clearly describe their meaning. These
tags help improve readability, SEO, and accessibility.
<header> - Page/Header Section
s
Represents the top section of a webpage (logo, navigation, heading).
te
o
N
ta
<nav> - Navigation Links
up
G
Contains main navigation links of a website.
sh
yu
Pi
<section> - A Section of Content
Groups related content together.
<article> - Independent Content (Blog, News, Posts)
Represents independent content like blog posts or articles.
es
<footer> - Footer Section
ot
Represents the bottom section of a webpage (copyright, social links).
N
ta
<main> - Main Content of the Page
up
G
sh
u
<figure> and <figcaption> - Images with Caption
📌 <figure> is used to group images/videos with captions.
y
📌 <figcaption> provides a caption for the image.
i
P