1. What is CSS (Introduction)
* CSS stands for Cascading Style Sheets. It’s a styling language that works together with HTML to make a web page look beautiful and well-structured. HTML defines what to show, while CSS defines how to show it.
Simple Example:
h1 { color: blue; text-align: center; }
Is code ka matlab hai: → Page ke sabhi <h1> elements ka color blue ho jaye aur wo center me aaye.
2. How CSS Works (Cascading Concept)
3. CSS Syntax
4. CSS Selectors Explained
Selectors CSS ka base hote hain. Ye batate hain kaunse HTML element par style apply hoga.
1️⃣ Element Selector
HTML tag ko directly select karta hai.
2️⃣ Class Selector
Custom name ke sath elements ko select karta hai (. lagake).
3️⃣ ID Selector
Unique element ke liye use hota hai (# lagake).
4️⃣ Universal Selector
Ye sab elements par apply hota hai.
5. The Box Model (Very Important)
Har HTML element ek box hota hai jisme 4 layers hoti hain:
-
Content – text/image hota hai
-
Padding – content aur border ke beech ka space
-
Border – element ki boundary
-
Margin – border ke bahar ka space
Visual:
🟩 Margin → 🟨 Border → 🟦 Padding → 🟧 Content
6. CSS Units (Size Measurement)
Absolute Units:
-
px → fixed pixel
-
pt → print media
Relative Units:
-
em → parent font-size based
-
rem → root font-size based
-
% → percentage
-
vw/vh → viewport width/height
7. Colors and Backgrounds
CSS me colors likhne ke 3 tarike:
-
Name → red, blue
-
Hex → #ff0000
-
RGB → rgb(255, 0, 0)
Background Image:
8. Position Property
Element ko page me move karne ke liye use hota hai:
-
static
-
relative
-
absolute
-
fixed
-
sticky
9. Display Property
| Value | Meaning |
|---|---|
| block | pura line le leta hai |
| inline | line ke andar fit hota hai |
| inline-block | dono ka mix |
| flex | flexbox layout |
| grid | grid layout |
10. Flexbox (Modern Layout System)
Important Properties:
-
justify-content
-
align-items
-
flex-direction
11. CSS Grid (Advance Layout)
-
repeat(3, 1fr) → 3 equal columns
-
gap → space between items
12. Responsive Design (Media Queries)
👉 Tip: Always mobile-first design karo.
13. Transitions and Animations
Transition
Animation
14. CSS Variables
15. Dark Mode with CSS
16. CSS Shadows
17. Hover Effects
18. Gradient Backgrounds
19. Animated Buttons
20. Final Summary
Now you’ve become a CSS Master!
Is guide me aapne seekha:
✔ Selectors
✔ Box Model
✔ Units
✔ Colors & Background
✔ Flexbox
✔ Grid
✔ Responsive Design
✔ Animations
✔ Variables
✔ Dark Mode
✔ Shadows & Effects
Agar in concepts ko real projects me apply karoge to aap modern, clean aur professional UI bana paoge.

0 Comments