CSS Colors, Fonts aur Styling
Colors in CSS
CSS me colors set karne ke kai tareeke hote hain jaise:
- Named Colors: Jaise
red
,blue
,green
. - Hexadecimal Colors: Jaise
#ff0000
,#00ff00
. - RGB Colors: Jaise
rgb(255, 0, 0)
. - RGBA Colors (opacity ke saath): Jaise
rgba(255, 0, 0, 0.5)
. - HSL Colors:
hsl(120, 100%, 50%)
.
red
#00aaff
rgb(255,200,0)
rgba(255,0,0,0.5)
hsl(240,100%,50%)
Fonts in CSS
Fonts ka use text ko attractive aur readable banane ke liye hota hai. CSS me font family, size, weight aur style define kiye ja sakte hain.
- font-family: Text ka font select karta hai. Jaise
Arial
,Verdana
,Georgia
, ya custom fonts. - font-size: Text ka size set karta hai. Jaise
16px
,1.2rem
. - font-weight: Text ki motai ko control karta hai. Jaise
normal
,bold
,700
. - font-style: Text ko italic ya normal banata hai.
Arial font sample text
Courier New font sample text
Georgia font sample text
Text Styling Properties
- color: Text ka color set karta hai.
- text-align: Text ko left, center ya right align karta hai.
- text-decoration: Text par underline, overline, line-through ya none apply karta hai.
- text-transform: Text ko uppercase, lowercase ya capitalize karta hai.
- letter-spacing: Letters ke beech space badhata hai.
- line-height: Lines ke beech height control karta hai.
p {
color: #db1d29;
text-align: center;
text-decoration: underline;
text-transform: uppercase;
letter-spacing: 2px;
line-height: 1.6;
}
In properties ko samajhkar aap apne website ko sundar aur professional look de sakte hain.