Hey.. Can any one please make me clear about margins in css in simplest way? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Hey.. Can any one please make me clear about margins in css in simplest way?

6th May 2020, 7:48 AM
Tan
Tan - avatar
15 Answers
+ 16
social distancing of 1. 5m is a margin. your clothes are the border and.. now lets get philosophical... your body is the padding of your soul.
6th May 2020, 8:25 PM
Oma Falk
Oma Falk - avatar
+ 15
how about another shape that has no equal side length
6th May 2020, 8:49 AM
Jano c͓̽o͓̽d͓̽e͓̽r͓̽
Jano c͓̽o͓̽d͓̽e͓̽r͓̽ - avatar
+ 5
Tan Hey there, consider the following example : ------------------------ | | | | | | | | ------------------------ Imagine, this is a box. The margin will determine where it should from it's parent. For example, if you set the margin of this box 20px: it will look like : 20px | ------------------------ | | | | --20px--| |--20px-- | | ------------------------ | 20px Here is a code sample :)) https://code.sololearn.com/WQO492Almp7V/?ref=app
6th May 2020, 8:47 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 5
The distance between an element an its outer/parent element on all four sides.
7th May 2020, 11:09 PM
Sonic
Sonic - avatar
+ 4
Tan and YOHANNES MULUKEN, whatever the side length of any shape, it is considered as a box. And the margin is set according to the box.
6th May 2020, 9:49 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 4
Margin-top:50px Margin-left:50px Margin-right:50px Margin-bottom:50px
7th May 2020, 10:23 AM
kamemuko derrick
kamemuko derrick - avatar
+ 3
Margins (Left, Right, Top, Bottom) This is way how margins assigned Margins are the space left before the compotent Paddings are space left inside the components
6th May 2020, 8:15 AM
Subash
Subash - avatar
+ 3
Arb Rahim Badsa Thanks sir... But what about Mr YOHANNES MULUKEN 's question? Even I want to know that, or is it possible?
6th May 2020, 9:42 AM
Tan
Tan - avatar
+ 3
answer granted
6th May 2020, 10:17 AM
Jano c͓̽o͓̽d͓̽e͓̽r͓̽
Jano c͓̽o͓̽d͓̽e͓̽r͓̽ - avatar
+ 3
Margin is the Empty space around a box
6th May 2020, 5:52 PM
Sam
Sam - avatar
+ 3
Yepp... Thanks to all to give me such examples .. Now better understanding it👍👍👍
7th May 2020, 11:43 AM
Tan
Tan - avatar
+ 2
Margin is the spaces outside of a box, separating it from the next element.. https://code.sololearn.com/WIHRj2g8SXyv/?ref=app
7th May 2020, 5:15 PM
francis uche
francis uche - avatar
+ 1
Margin creates a space between corners. Imagine you're doing an essay and your teacher tells you to create a margin in the left and right direction.
8th May 2020, 4:18 AM
Epsilon ︻╦̵̵͇̿̿̿̿╤──
Epsilon ︻╦̵̵͇̿̿̿̿╤── - avatar
8th May 2020, 10:43 AM
narayanaprasad
narayanaprasad - avatar
0
Every html element is defined by the box model. It is composed of the margin, border, padding and the content. Look at it as a rectangle inside a rectangle....and the margin is one of this.
8th May 2020, 5:58 AM
David Jaramillo
David Jaramillo - avatar