Skip to main content

CSS - Margin VS Padding in hindi / kya h / kese lagaye technamdev.blogspot.com

CSS - Margin VS Padding

CSS Box Model in Hindi



  • Element Content : element का content होता है | For Example, some text, images
  • Padding : Padding ये border के अन्दर का हिस्सा होता है और ये element का हिस्सा होता है |
  • Border : Border ये padding और margin के बीच का हिस्सा होता है |
  • Margin : Margin ये border के बाहर का हिस्सा होता है और ये element का हिस्सा नहीं होता है |

Example

Example पर border की बाहरी space ये margin होती है | border की अन्दर की space ये padding होती है |
<style>
p{
padding : 100px;
margin : 100px;
border : 5px #F00 solid;
}
</style>
<p>CSS stands for Cascading Style Sheet</p> 
CSS stands for Cascading Style Sheet

Live Example


Understand the Example given about Margin and Padding

<p style="margin:50px;background-color:yellow;">
margin:50px;
</p>
<p style="padding:50px;background-color:yellow;">
padding:50px;
</p>
margin:50px;
padding:50px;

MarginPadding
Margin ये एक element से दूसरे element तक दूरी बनाये रखता है |Padding ये अपने element के content से दूरी बनाये रखता है |
Margin ये element का हिस्सा नहीं होता है |Padding ये element का हिस्सा नहीं होता है |
Margin ये element के बाहर होता है |Padding ये element के अन्दर होता है |



Box-Model in CSS

CSS में Margins, Border और Paddings की length अलग -अलग होती है |
For Example,
<p style="width:300px;border:5px #000 solid;">
Total Width = width 300px + left border 5px + right border 5px = 310px
</p>
<p style="width:308px;border:1px #F00 solid;">
Total Width = width 308px + left border 1px + right border 1px = 310px
</p> 
<p style="width:250px;border:30px #F00 solid;">
Total Width = 250px + left border 30px + right border 30px = 310px
</p> 
<p style="width:250px;padding:20px;border:10px #F00 solid;">
Total Width = 250px  + left padding 20px + right padding 20px + left border 10px + right border 10px = 310px
</p>
<p style="width:250px;margin:20px;border:10px #F00 solid;">
Total Width = 250px  + left margin 20px + right margin 20px + left border 10px + right border 10px = 310px
<strong>Note : Margin is outside the border.</strong>
</p>

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;...