CSS Introduction :
CSS stands for cascadeing style sheets, CSS hum use karte hai Html document ko
style dena ke liya, CSS ki help sa he hum apne webpage ko cutomize karte hai
jesa text ko colour dena, text ki position, layouts, webpage ka design, etc yeh
sab hum css ki help sa karte hai.
CSS Syntax: p1
{color: blue; font-size:12px;}
CSS mein selector
hota hai or declaration hota hai or declaration mein property or property ki
value hoti hai, Yeh ek simple syntax hai css ka, isme app dek sakte hai
- Jo p1 hai vo humara selector hai hai kyuki hume iske element ko style karna hai, matlab jis bhi html element ko style karna hoga usko selector lega.
- color: blue; font-size:12px - Yeh humara declaration hai uss p1 element ka jisko hum style karega
- Declaration mein color jo hai vo property hai or blue uss property ki value hai
- Same font-size bhi property hai or 12px uski value hai
- Jab bhi app kisi html element ki property loga to app different properties bhi leni hogi to hamesha property or uski value ki baad ; semi-colon use karke dusri property or uski value liki jati hai.
Example:
<!DOCTYPE html>
<html>
<head>
<style>
p{
color: red;
text-align: center;
}
</style>
</head>
<body>
<p>Programming Warrior</p>
<p>Be a Warrior not a Worrier</p>
</body>
</html>
- App dek sakte ho p jo ek selector hai, color humne red liya, fir dusri property dekar text-align ki value center di hai or fir close kiya hai.
- Yeh syntax btaya hai mena abbi sirf agge apko or acha sa samjaoga ki humne isko kesa liya style ke ander kyu liya baki sab abb just mena ek syntax btaya hai.
Output: