Background Color क्या है?
Background Color का उपयोग किसी HTML Element या पूरे Web Page का Background (पृष्ठभूमि) रंग बदलने के लिए किया जाता है।
Definition:
Background Color वह CSS Property है जिसकी सहायता से किसी HTML Element की पृष्ठभूमि का रंग निर्धारित किया जाता है।
Syntax
selector{
background-color: color;
}
Example 1 – Background Color Name
body{
background-color: lightblue;
}
Output: पूरे Web Page का Background हल्का नीला (Light Blue) हो जाएगा।
Example 2 – Background Color (RGB)
body{
background-color: rgb(255,255,0);
}
Output: Background Yellow दिखाई देगा।
Example 3 – Background Color (HEX)
body{
background-color:#00FF00;
}
Output: Green Background दिखाई देगा।
Example 4 – Background Color (HSL)
body{
background-color:hsl(200,100%,70%);
}
Background Color किन Elements पर लगाया जा सकता है?
- Body
- Heading
- Paragraph
- Div
- Table
- Button
- Form
- Section
Example – Heading Background
h1{
background-color: yellow;
}
Example – Paragraph Background
p{
background-color: pink;
}
Example – Div Background
div{
background-color: lightgreen;
}
Complete Practical Example
Welcome to UICT
This is Background Color Example.
This is DIV Background.
Background Color के लाभ
- Website आकर्षक बनती है।
- Content पढ़ने में आसान होता है।
- Different Sections को अलग दिखाया जा सकता है।
- User Experience बेहतर होता है।
- Professional Design बनाने में मदद मिलती है।
ध्यान रखें
✔ Color Name
✔ RGB
✔ HEX
✔ HSL
चारों तरीकों से Background Color लगाया जा सकता है।
Viva Questions
Q1. Background Color क्या है?
Ans: HTML Element की पृष्ठभूमि का रंग बदलने वाली CSS Property।
Q2. Background Color की Property क्या है?
Ans:
background-color
Q3. Body का Background कैसे बदलते हैं?
body{
background-color:lightblue;
}
Q4. क्या Background Color सभी HTML Elements पर लगाया जा सकता है?
Ans: हाँ।
Q5. Background Color कितने तरीकों से लिखा जा सकता है?
Ans:
- Color Name
- RGB
- HEX
- HSL
Practical Assignment
Assignment 1
एक Web Page बनाइए जिसमें—
- Body Background = Light Blue
- Heading Background = Yellow
- Paragraph Background = Pink
Assignment 2
RGB का उपयोग करके—
- Red Background
- Green Background
- Blue Background
बनाइए।
Assignment 3
HEX Code का उपयोग करके—
- Header
- Main
- Footer
के अलग-अलग Background बनाइए।
Assignment 4
HSL का उपयोग करके 5 अलग-अलग Background Colors बनाइए।
Assignment 5
5 अलग-अलग एक Button बनाइए। एक Student Profile Card बनाइए जिसमें— सभी Sections के अलग-अलग Background Colors हों। एक Landing Page तैयार करें जिसमें— File Name: Assignment 6
Mini Project – Colorful Student Card
Final Project – UICT Landing Page
उपयोग करें
Lab Practical
background-color-practical.htmlRequirements
Home Assignment