+ 3
Hey.. Can any one please make me clear about margins in css in simplest way?
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.
+ 15
how about another shape that has no equal side length
+ 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
+ 5
The distance between an element an its outer/parent element on all four sides.
+ 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.
+ 4
Margin-top:50px
Margin-left:50px
Margin-right:50px
Margin-bottom:50px
+ 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
+ 3
Arb Rahim Badsa
Thanks sir...
But what about Mr YOHANNES MULUKEN 's question? Even I want to know that, or is it possible?
+ 3
answer granted
+ 3
Margin is the Empty space around a box
+ 3
Yepp... Thanks to all to give me such examples
.. Now better understanding it👍👍👍
+ 2
Margin is the spaces outside of a box, separating it from the next element..
https://code.sololearn.com/WIHRj2g8SXyv/?ref=app
+ 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.
+ 1
You may find answer in
1) https://www.w3schools.com/cssref/pr_margin.asp
2) https://www.smashingmagazine.com/2019/07/margins-in-css/
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.