Skip to main content

CSS - CSS Backgrounds kese set kre, image kese lagaye

Websites के categories के अनुसार उसका background भी बदलना जरुरी होता है | आपने देखा होगा कि कई websites का backgrounds; अलग-अलग colors में होता है या कुछ websites के backgrounds पर images होते है |
HTML का default background color ये white होता है, लेकिन अगर कुछ लोग चाहते है तो इस background color को बदल भी सकते है |
Background Related CSS Properties
  • background
  • background-color
  • background-image
  • background-attachment
  • background-repeat
  • background-position

background property(All in One)

Syntax :
background : color_name;
background : url("image_path");
background : url("image_path") background_repeat;
background : url("image_path") background_repeat/position/attachment;

background : color_name;

निचे div1, div2 और div3 को एक ही color को अलग-अलग प्रकार से दिया गया है | निचे color को अलग-अलग प्रकार से दी जाने वाली values को दिया गया है |
Type of ValueDescription
color_nameयहाँ पर color का नाम दिया जाता है | For Example, background : red
hexadecimal color codeयहाँ पर hex code color भी दिया जाता है | For Example, background : #F00
rgb color codeयहाँ पर rgb(red,green,blue) color code भी दिया जाता है | background : rgb(255, 0, 0)
hsl color codeयहाँ पर hsl(hue,saturation,luminance) color code भी दिया जाता है | background : hsl(360, 100%, 50%)

.div1{
 background : #F00; /* hexadecimal color code */
}
.div2{
 background : red; /* color name */
}
.div3{
 background : rgb(255, 0, 0); /* rgb color code */
}
.div4{
 background : hsl(360, 100%, 50%); /* hsl color code */
}
Output :

background : url("image_path");

Exmaple में myDiv selector पर image background दी गयी है |
.myDiv{
 background : url("nature.jpg");
}

background : url("image_path") background_repeat;

Example में myDiv selector पर background image के साथ उसे repeat नहीं किया गया है | अगर height, width और repeat नहीं दिया जाता है तो by default image को repeat किया जाता है |
Example 1 :
.myDiv{
 background : url("nature.jpg") no-repeat;
}

Example 2 :
Example में myDiv selector पर image को horizontally(repeat-x) repeat किया गया है |
.myDiv{
 background : url("nature.jpg") repeat-x;
}

Example 3 :
Example में myDiv selector पर image को vertically(repeat-y) repeat किया गया है |
.myDiv{
 background : url("nature.jpg") repeat-y;
}

background : url("image_path") background_repeat/position/attachment;

Example 1 :
Example पर image background attachment को fixed किया गया है |
.myDiv{
 background : url("nature.jpg") no-repeat fixed;
}

Example 2 :
Example पर image background position को right top पर दिया गया है |
.myDiv{
 background : url("nature.jpg") no-repeat right top;
}


Background PropertyDescription
background-colorElement पर background color दिया जाता है |
background-imageElement पर background image दी जाती है |
background-attachmentWebpage पर background attachment को fixed या scroll set किया जाता है |
background-repeatbackground को किस तरह repeat होना चाहिए या repeat नहीं होना चाहिए ये set किया जाता है |
background-positionbackground की position set की जाती है |

Comments

Popular posts from this blog

Create a Responsive Login Form in HTML and CSS in Hindi

Create a Responsive Login Form in HTML and CSS in Hindi                                                              Login Form in HTML and CSS In this video, we will we see How to Create a Responsive Login Form in HTML and CSS in Hindi step by step. As you can see I try to make a Login form that should be different from others available online on any social media. Believe me, you gonna learn many new technique and tips on how to make a Responsive Login Form in HTML and CSS in Hindi. Let's talk about the background of the Login form in Hindi first. You can see It's a diagonal background and I know must of are thinking how we can create a diagonal webpage. Believe me, I wrote only one line of code to get the diagonal background on my Login Form in Hindi. background-image: linear-gradient(to top right,...

CSS - CSS Text in hindi, css text kya h, kese likhe Technamdev.blogspot.com

आपने देखा होगा कि कई websites के text का color अलग-अलग होता है | HTML का default text color ये black होता है, लेकिन अगर कुछ लोग चाहते है तो इस text color को बदल भी सकते है | Text Related CSS Properties color direction letter-spacing text-align text-decoration text-indent text-shadow text-transform word-break white-space word-spacing word-wrap Color Property for Text Color निचे div1, div2 और div3 को एक ही color को अलग-अलग प्रकार से दिया गया है | निचे color को अलग-अलग प्रकार से दी जाने वाली values को दिया गया है | Type of Value Description color_name यहाँ पर color का नाम दिया जाता है | For Example, color : red hexadecimal color code यहाँ पर hex code color भी दिया जाता है | For Example, color : #F00 rgb color code यहाँ पर rgb(red,green,blue) color code भी दिया जाता है | color : rgb(255, 0, 0) hsl color code यहाँ पर hsl(hue,saturation,luminance) color code भी दिया जाता है | color : hsl(360, 100%, 50%) .div1{ color : #F00; /* hexadecimal color code...

CSS - CSS Colors in hindi, css color kese select kre , kya h.

Colors ये websites के लिए बहुत ही महत्वपूर्ण हिस्सा है | अगर आप एक बढ़िया website चाहते हो तो colors का इस्तेमाल किया ही जाना चाहिए | c o l o r Some Common Colors in CSS Color Name Hex Color Code RGB Color Code WHITE #FFFFFF RGB(255, 255, 255) SILVER #C0C0C0 RGB(192, 192, 192) GRAY/GREY #808080 RGB(128, 128, 128) BLACK #000000 RGB(0, 0, 0) RED #FF0000 RGB(255, 0, 0) MAROON #800000 RGB(128, 0, 0) YELLOW #FFFF00 RGB(255, 255, 0) OLIVE #808000 RGB(128, 128, 0) LIME #00FF00 RGB(0, 255, 0) GREEN #008000 RGB(0, 128, 0) AQUA/CYAN #00FFFF RGB(0, 255, 255) TEAL #008080 RGB(0, 128, 128) BLUE #0000FF RGB(0, 0, 255) NAVY #000080 RGB(0, 0, 128) FUCHSIA #FF00FF RGB(255, 0, 255)) PURPLE #800080 RGB(128, 0, 128)) Example <h1 style="background-color:white;">WHITE</h1> <h1 style="background-color:silver;">SILVER</h1> <h1 style="background-color:gray;">GRAY</h1> <h1 style="background-color:black;...