About 50 results
Open links in new tab
  1. What is the difference between margin and padding in CSS?

    Feb 3, 2010 · The space between two frames is the margin. With this in mind, a good rule of thumb is to use margin when you want to space an element in relationship to other elements on the wall, and …

  2. css - Why padding is included in height sometimes? - Stack Overflow

    Mar 11, 2013 · The box-sizing property can be used to adjust this behavior: content-box gives you the default CSS box-sizing behavior. If you set an element's width to 100 pixels, then the element's …

  3. css - Difference between margin and padding? - Stack Overflow

    May 11, 2011 · The main difference between margin and padding is that margin helps to create space around the element outside the border, while padding helps to create space around the element …

  4. How do I prevent the padding property from changing width or height …

    Which means, that if you set an element width to 200px and then add a padding of 20px on both horizontal end, this would result to a total width of 240px for that element. to fix this, you simply need …

  5. How to make padding:auto work in CSS? - Stack Overflow

    Aug 31, 2013 · This Stack Overflow post explains why padding:auto is not valid in CSS and offers alternative solutions for dynamic padding adjustments.

  6. css - Absolute positioning ignoring padding of parent - Stack Overflow

    How do you make an absolute positioned element honor the padding of its parent? I want an inner div to stretch across the width of its parent and to be positioned at the bottom of that parent, basi...

  7. CSS padding is not working as expected in Outlook

    As a start you could try to affect all elements with * {margin: 0; padding: 0;} in your extrernal style sheet. I use to do this when debugging. Then set margin/padding locally on the individual elements (as you …

  8. css - Does element width include padding? - Stack Overflow

    Jan 15, 2011 · In this model, the width of an element does not include padding or borders. For example: #foo { width: 10em; padding: 2em; border: 1em; } will actually be 16em wide: 10em + 2em padding …

  9. How do negative margins in CSS work and why is (margin-top:-5

    Jul 16, 2012 · I see you're trying to vertically center the element, so why do you have to set margin-top:-8px; and not margin-top:-50%;? Well, vertical centering in CSS is harder than it should be. When …

  10. css - What does auto do in margin: 0 auto? - Stack Overflow

    Jul 3, 2010 · What does auto do in margin: 0 auto;? I can't seem to understand what auto does. I know it sometimes has the effect of centring objects.