margin vs padding

Solutions on MaxInterview for margin vs padding by the best coders in the world

showing results for - "margin vs padding"
Louison
29 Feb 2020
1Margin is on the outside of block elements, padding is on the inside.
2
3Use margin to separate the block from things outside it
4Use padding to move the contents away from the edges of the block.
5
6Main differences:
7- Vertical margins of adjacent items will overlap, padding will not
8- Padding is included in the click region and background color/image,
9but not the margin
Lenny
14 May 2016
1padding is the space between the content and the border,
2whereas margin is the space outside the border.
Joshua
22 Nov 2019
1/* Answer to: "css padding vs margin" */
2
3/*
4  Margin is outer space of an element, while padding is inner space
5  of an element. Margin is the space outside the border of an
6  element, while padding is the space inside the border of it.
7  Margin accepts the value of auto: margin: auto , but you can't
8  set padding to auto.
9
10  For more information, head over to:
11  https://stackoverflow.com/questions/2189452/when-to-use-margin-vs-padding-in-css
12*/
Giulia
17 Jan 2021
1Margin is said to be the outer space of an element,
2the margin is the space outside of the element's border. 
3Padding is said to be the inner space of an element, 
4the padding is the space inside of the element's border.
queries leading to this page
margin vs paddingdifereence between padding and margincss what is the difference between margin and paddingpadding marginepadding vsmargin vs padding htmlpadding or margin csswhen should i use margin or paddingdifference margin and paddingpadding and margin cssdifference bwteen margin and paddingcss padding or marginser 4 values margin react nativepadding vs margin in cssmargin and paddingwhat is difference between margin and padding in csspadding or margin helpcss difference between padding and margindefine margin and padding in css in the margin and padding propertiescss utility margin paddingreact native margin shorthanddifference between margin and padding property of cssspadding top vs margin topwhat is differrence between margin and paddingwhen to use padding vs marginwhen to use margin versus padding csspadding and margin for div csscss padding margin differencemargin and padding differencecss margin and padding defult margin padding vsmake the padding equal to the marginorder of margin and padding in cssdoes teh body have margin and padding cssmargin or padding 3fpaddinf vs margindiv margin vs paddingmargin and padding i ncsspadding margin representationwhen to use margin and padding in csscss margins vs paddingvisual representation of margin and paddingdiffernce between margin and paddingmargin css shorthandwhat is the difference between a margin and paddingdifference margin padding cssdiffernce between padding and marginscss margin vs padding vs borderwhat is margin and padding in cssdisplay padding marginin css 2c what is the difference between margin and padding 3fmargin auto react nativedifference between padding and margin cssmargine and paddingreact native style margin rightin css 2c what is the difference between margin and padding 3fmargin vbs paddingmargins and paddings cssdifference between padding and marginsmargin and padding in csswhat is padding and margin differencemargin vs paddinhhow t use margin in react nativewhat is the difference between margins and padding 3fpadding top vs margin topmargin top bottom react nativemargin and padding in htmlcss padding marginwhat is difference between padding and margincss padding and margin differencethe difference between margin and paddingpadding border margin andmargin padding differencemargin vs padding react nativewhat is the difference between margin and paddingreact native paddingdifference between margin border and paddingpaddinfg vs marginhow to add padding and margin in react nativebest margin and padding in cchow to do margin in react nativepadding margin html attributesthe diffrence between padding and marginreact native padding margincss margin vs paddindcss padding or margin which to usemargin and 2for paddingpadding margindifferntiae in padding and marginpadding margingcss padding vs margin w3schoolspadding react nativecss padding and marginhow to read margin padding toolwhen to use margin vs paddingdifference between padding and margingreact native margin automargin padding css vsmargin and padding structurepading vs marginwhat 27s the difference between margin and padding in csscss margin and paddingdifference padding and margin csshtml padding vs margincss difference between margin and paddingreact native margin right and leftmargin and paddin in csswhat is difference between padding and margin in react nativedifference margin and padding cssuse of margin and paddingpadding and margin difference in htmlwhen to margin and when to padding in csswhen to use padding and marginpadding margin explainedhow to style with margin and paddingwhen to use padding and when to use marginmargin padding visual for htmlcss margin vs padding differenceposition vs padding vs marginborder vs paddingpadding and margin shorthandwhen using padding or marginreact native margin padding from all side padding vs margin cssexplain the difference between padding and margin in csshow to margin auto in react nativewhat is the difference between margin and padding 3fpadding vs margingreact native using auto margin for stylepadding or margin for spacingmargin and padding attributespadding vs margin htmlwhat is difference between margin and paddingmargin vs paddcss padding or margin for spacinghtml css padding vs marginpadding vs marginemargin vs padding in htmlpadding margin cssdifference between padding and marginpadding and margin n cssmargin vs padding in csspadding with marginmargin and padding on html csswhen doing padding and margin what comes firstpadding vs margin with textdifference margin paddingdifference in margin and paddingcss padding vs margin vs bordermargins and paddingpadding top vs margin bottompaddign vs marginpadding and margin differencepaddding vs margincss difference margin paddingwhat is margin and padding forwhen use margin or paddingmargin vs padding csspadding margin differencereact native padding between itemscss name for both margin and paddingpading margindifferrence between margin and paddingmargin vspaddingpadding vs margin differencemargin vs padding vs bordercss w3schools margin vs paddingis it ok to use padding in react nativemargins vs padding csspadding vs margin use casemargin vs padingmargin and padding conceptmargin vs paddngcss margin vs padding vs border which one to usediv padding vs marginmarging vs paddingwhat is the difference margin and paddingpadding and margin in csswhat is the difference between css margin and paddinghow to aconsider margin and paddingmargin padding in cssresponsive padding and margin in react native webpadding vs marginsdifference between the margin and padding properties cssmargin react nativecss margin paddingpadding vs margin vs borderpadding vs margindiff b 2fw padding and margindifference between margin and padding and bordermargin and padding shorthandmargin padding csspadding vs margin examplecss marginpadding margin and other thingscss margin padding differencemargin and padding in css 5cpadding 26 margindifference between padding and margin in htmlpadding top react nativepadding vs marginmargin and padding difference in csspadding vs padding leftwhat is margin and paddingin csscan i use margin auto react nativedifference between margin and padding in cssmargin padding visualwhat 27s the difference between margin and paddingdifferences between padding and marginhtml difference padding marginwhen to give padding and when to give marginpadding and margin frameworkcan you have margin and padding csswhich to use margin or paddingwhat is margin and paddinghow margin and padding worksmargin and padding 2acss margin and padding explainedwhat is the difference between padding and margin in cssmargin and padding cssis padding better or marfincss padding vs margin for widthwhen to use margin and paddinghtml margin vs paddingcss difference padding marginreact native margin vs paddingdifference between border and paddingmargin and padding and other css property values shorthandhtml margin and padding differencecss padding vs margin vswhat is the difference between padding and margin in htmlmargin padding 0 cssmargin or padding csshow to add margin and padding in react nativewhat is the difference between the margin and padding propertiesdifference padding and margincss margin differencecss margin and padreact native marginhow to use margin in react nativewhich to use padding or marginreact native set margin and padding to 0padding vs margin vsdifference between margin and padding set margin from right react nativecss padding vs margingmargin and padding 3a cssmargin cs paddingdifferene between margin and paddingdifference between margin and padding in htmlshould i use padding or margindo divs have padding or marginhtml margin versus paddingwhat is the difference between margin and padding in cssdifference between margin and padingcss margin vs paddingbottom padding css vs marginmargin padding react nativewhat is margin vs paddinghtml padding and marginuse margin or paddingmargin and padding in react nativereact native margin leftmargin border padding differencewhen to use paddingmargin vs padmargin or padding css syntaxmargin vs padding when to usecss padding vs marginmargin and padding in bootstrappadding and margincss incss when to use margin vs paddingmargin and padding for websitedifference padding vs marginpadding margin htmlmargin paddingpadding and margingmargin and padding differencespadding and marginpadding vs margin ccmargin top vs padding topwhat is good to use padding vs margincss padding versusdifference between margin and paddingmargins vs paddingpadding and margin andwhich is better 3a margin or paddingmargin auto in react nativeshould you use padding or margin or bothreact native margin 25margin vs padding cssdifference between margin and padding csspadding and margin difference in cssmargintop react nativedifferece between margin and paddingcan i make divs display on margins 3f 3fdifference of padding and margindifference between padding and margin in programmingwhat is the difference between padding and marginmargin and padding react nativeleft padding is betterdiferen c3 a7a entre margin e paddingpadding 2c marginmargin or paddingwhat is the difference between padding and margin in css with examplereact native margin rightwhen to use margin 2c when to use paddingpadding and margin in htmlmargin or padding toppadding vs margindwhen to use padding and margin in csswhat is the difference between padding and margin 3fwhat is the difference between margin and paddinng in cssdifference between padding and margin htmlwhat is the use of margin and padding propertiesmargin and padding standardhow to set margin in react nativemargin padding leftmargin a paddinghow to add padding and margin in cssreact native margin propertywhen to use margin and when to use paddingpadding css vs marginwhen to use margin or paddinguse margin or padding in cssmargin and padingdifference between padding and margin in csspadding vs margin to space textpadding or marginreact native margin yadding margin in react nativewhats the difference between padding and margincss margin and padding differenceshow padding vs margin csswhat 27s the difference between padding and marginpaddig vs marginresponsive padding and margin in react native web paddingwhat is padding and marginshow padding vs marginis padding and margin same in csshow to make margin auto in react nativein css 2c what is the difference between margin and paddingmargin vs border vs paddingmargin paddingm cssreact native margin ptmargin padding border differenceborder margin padding differencemargin and padding shothand for react nativepadding margin contentpadding and margin diffencespadding vs margin vssdf betwenn margin and paddingdiffernt between padding and marginborder vs margin vs padding cssmargin top react nativediff c3 a9rence padding marginwhat difference between margin and paddingdifferent between padding and marginpadding and margin definationcss padding margin diagrammargin vs padding