Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Whenever I format a website according to a PSD file,
I always wonder if the space should be from the top element or the bottom one.

So if I have 2 elements that are seperated by some space, I normally choose
the top one, but I can't find a real reason not to choose the one on the bottom.

Any ideas?

share|improve this question

closed as not constructive by paulmorriss, DisgruntledGoat, John Conde Nov 13 '11 at 0:11

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Could you edit your question to include a simple code example that shows the two elements you're trying to lay out? It's hard to tell exactly what you're asking at present. – Nick Jul 7 '11 at 14:31
up vote 2 down vote accepted

I would typically add it to the upper element as padding-bottom:10px (or whatever whitespace size you need.

I find that I typically want "any content after this" to be a certain distance away. very rarely do I find the reverse ideal. (although its an easy modification if needed)

share|improve this answer
Be also aware of margin-collapsing, which allows to add the space to both elements. – feeela Jul 7 '11 at 23:34

If it's always the same two elements as siblings (for example, a header div followed by a menu div at the top of each page), then there is no difference between adding margin-bottom (or padding) to the top vs. adding margin-top to the bottom.

OTOH, if the elements in question sometimes appear elsewhere in the document (for example, an H2 can be an article title followed by a byline in one place or a subheading followed by a paragraph elsewhere), then the answer will depend on how you need them to behave in each of the places.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.