padding
is the space between the content and the border
, whereas margin
is the space outside the border. Here’s an image I found from a quick Google search, that illustrates this idea.
More Related Contents:
- What is the difference between “word-break: break-all” versus “word-wrap: break-word” in CSS
- How to remove Firefox’s dotted outline on BUTTONS as well as links?
- css3 transition animation on load?
- Background color of text in SVG
- How to resize the ClipPath area of SVG?
- css z-index lost after webkit transform translate3d
- Remove header and footer from window.print()
- Amazon S3 CORS (Cross-Origin Resource Sharing) and Firefox cross-domain font loading
- “text-align: justify;” inline-block elements properly?
- How to rotate the background image in the container?
- Pure CSS collapse/expand div
- how to avoid extra blank page at end while printing?
- Webkit bug with `:hover` and multiple adjacent-sibling selectors
- Next.js Global CSS cannot be imported from files other than your Custom
- CSS Specificity and Inheritance
- Fallback fonts on special characters
- Nested rows with bootstrap grid system?
- How do I line up 3 divs on the same row?
- Apple-like scrollbars using CSS
- Why centering with margin 0 auto works with display:block but does not work with display:inline-block ?
- Filling water animation
- How to ignore parent element’s overflow:hidden in css
- Div side by side without float
- Pure CSS animation visibility with delay
- CSS specificity or inheritance?
- CSS How to set div height 100% minus nPx [duplicate]
- Gray out image with CSS?
- How can I align 3 divs side by side?
- Rounded side, not rounded corners
- How to override the properties of a CSS class to avoid copying and renaming styles