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

    Nov 6, 2016 · 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 …

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

    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 …

  3. Why does CSS padding increase size of element? - Stack Overflow

    Jan 22, 2011 · 21 According to , the rendered width of a box type element is equal to the sum of its width, left/right border and left/right padding (left/right margin comes into play as well). If …

  4. 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 …

  5. 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 …

  6. 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 …

  7. html - How does padding percentage work? - Stack Overflow

    Oct 15, 2013 · In the example above, .elementContainer has a padding-top of 50%. This should be calculated based on the parent element's (.wrapper) height, which means it should come …

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

  9. css - Absolute positioning ignoring padding of parent - Stack …

    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, …

  10. 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 + …