Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:59:24+00:00 2026-06-13T07:59:24+00:00

This link (and all the other ‘margin vs padding’ questions I’ve checked), whilst asking

  • 0

This link (and all the other ‘margin vs padding’ questions I’ve checked), whilst asking the same question seems to only state the difference between the two. It says, “When you want space outside, use margin. When you want space inside use padding”.

That’s fair enough but if you look at This quick jsFiddle example, I’ve used various CSS to get the exact same effect.

This question is subjective and may get closed but I waste a lot of time deciding, “Should I put padding on the containing element… Or margin on the internal element itself.”

If you extend those divs to have multiple paragraphs then the third example soon fails if you want to have a consistent border/background. The one using Margin on the <p> tag seems to look better as it separates the paragraphs automatically.

Is there an easy thought process/set of questions I can ask myself to come to a conclusion when styling my website?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:59:25+00:00Added an answer on June 13, 2026 at 7:59 am

    I think Itay Moav answers from this question provides a good check list on what conditions you would like to use margin, and on what conditions you would like to use padding. Let me copy-paste it here:

    1. You have some kind of background properties. Margins won’t get them.
    2. You have a border
    3. You use TD (no margins)
    4. Two nested items, The margins are collapsed together, where paddings not. (need to check this one)
    5. They probably affect the width and height of the element differently. (If some one knows better, pls edit this).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This link links to an image: http://pix-all.com/t/w Every other browser displays this image, only
This is working in all other browsers except IE. I am building a link
This link states that all columns that are nullable should be added to the
please try this link for getting my code. its working in all browsers not
I have borrowed code from this link PHP regex templating - find all occurrences
On this link it says The current implementation will simply broadcast all the publish
My question is similar to a question on this link : Creating a CoreData
I want to calculate the total size of all .mobi files from this link
I have this code and working great in all other browser but IE. There
I'm having a hard time getting this to work in IE. All the other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.