My web designer tells me that in a web page, the empty margins or padding should always be multiples of a standard. For example 6 px, 12px, 18px. This should produce nicely balanced lay-outs. I would like to learn a little bit more about it:

Should one really not violate this at all?

Should the standard be the same horizontally and vertically?

  • 3
    I'm not proposing to close the question here, but graphic design SE is another good place to ask. Commented Apr 20, 2011 at 6:21
  • The reason for the bounty from me is I think this question is very interesting, and needs to be answered correctly. My answer is just one from my point of view. I think that there is more appropriate ones, taking full act on the complexity (like @Coswyn). Commented Apr 25, 2011 at 9:16
  • 1
    "empty margins or padding should always be multiples of a standard" (emphasis mine) - usage of the word "always" is a pretty good indicator of a false statement, because absolute statements are always false.
    – zzzzBov
    Commented Jul 25, 2012 at 17:38
  • 2
    @zzzzBov "Absolute statements are always false" is an absolute statement. So are you wrong? Commented Aug 23, 2017 at 20:30
  • 1
    @toshiomagic no idea.
    – zzzzBov
    Commented Aug 23, 2017 at 20:34

7 Answers 7

  • The best learning resource for this would be a good introduction on typography – probably the seminal classic by Bringhurst (see http://webtypography.net for a good roundup applied to the web), though e. g. Spiekermann's ‘Stop Stealing Sheep…’ is not bad for starters, either – and on design grids (see my answer here on UXexchange).

  • When designing grids you are mostly using a basic module (proportions ideally defined by working from the content outwards) that all content is fitted to (i.e. multiples of it).

  • Vertical and horizontal margins between blocks are in most cases different. Vertical whitespace is often oriented on the baseline grid (see e.g. Bringhurst, again). Using one is highly recommended to achieve at a unifying vertical rhythm.

  • The minimum amount of horizontal whitespace, i. e. primarily the separation between columns of body text (gutter), is governed by Gestalt psychology with font size, line spacing, and line width as main influencing factors. You should place text blocks far enough from another such that your recipients will be able to see them as distinct units of their own. A traditional rule of thumb would make the gutter at least 1.5 ems wide in order to appear significantly wider than any possible whitespace within a line of text. On the screen, good line spacing tends to be a little bit wider than in traditional print, though. Hence you will probably need a little bit more than that. Using the same value as your baseline grid is a good guess to start with in most cases.

  • BTW: design standards – unless significantly backed up by ergonomics or cognitive psychology – are never standards in the more rigid sense of the word. You may violate any ‘standard’ as long as you know why you are doing it.


Yes... and no. What your designer might refer to is proximity through grouping. The white spaces (in your case margins) separates different groups of elements from each other.

More on the topic: Grouping Elements for Clear Web Page Design


It's better to use relative values - "em"s or percents, because margin looks good only in specific width/height ratio.

Relative sizes are useful even in fixed layouts, because when you need it to shrink/widen a little, you have to change it only in one place.

So the answer is: Do not use pixels, use "em"s for margins as well as box sizes, and it IMHO should be between 0.5em to 2em - depending on visual experience.

And ratio between vertical and horizontal margin depends on overall "vertical&horizontal" rhythm (google).

  • To be clear: 1em = font-size, 2em = 2 * font-size etc. Therefore: if h1 and p both have margin of 0.5em, and h1 has 20px and p 12px font-size, then heading's margin is translated to 10px and the paragraph's to 6px. Commented Apr 24, 2011 at 11:37
  • But layout proportions do not scale in an optically linear manner as the perceived visual ‘blackness’ of the content varies when scaled (at least where type is concerned). Therefore, using relative units does not help that much in that respect, IMHO. Commented Apr 25, 2011 at 22:45

It can be helpful to have standard spacing within content sections. IE paragraphs, headings and lists should all have the same amount of spacing below them as that creates rhythm. The rule of thumb though is to maintain balance and consistency.


This site's layout is a good example of how a combination of adherence to multiple patterns yields balanced proportions and an overall consistent structure. The logo, for example, is spaced approximately 14px at the top and bottom within its header segment though it's indented 18px from the edge of the question header, making the top and bottom spacing approximately 30% smaller than the left side - other elements within the header are spaced similarly. On the other hand, the spacing of the text within the question header is approximately 9px on the bottom, 13px on the top, and 24px on the left side. That sets the top spacing to be approximately 50% smaller than the left side, and the discrepancy in the bottom is relative to the alignment of the text to the bottom of the main header in addition to it being header text (separated from the main content with a divider, though closer to that content which it more closely relates to than anything else that surrounds it).

Proportions vary and are an art in themselves. There is a math to it all, but bringing a complex structure together is, in practice, a generally intuitive process.

I'm sure there are multiple books and online resources that touch on this, and they are all likely helpful in their own ways, but my best advice is to be an avid observer of proportions in the things around you - in themselves and relative to their environments and other things in that environment - especially in nature. In time you will hone your intuition and begin to more naturally imitate those proportions and apply them in their appropriate settings.


Consider using a grid layout where your margins are also given by that grid. I tend to use the 960 Grid System but there are many more that other swear by.

For me the benefit of this is largely from choosing something once that works and then not having to spend time thinking about it every time something needs to be laid out.

  • You should IMHO not mistake the technical implementation of the grid (i.e. the main reason for using a CSS framework) with the underlying design. The default values in 960gs, Blueprint etc. are exactly that: defaults, i.e. tolerable guesses to start from. But they do not release you from making a design decision that might be better suited to your content. All those frameworks are quite well adaptable to different grid setups (see the countless grid generators for them on the web). Commented Apr 26, 2011 at 7:28
  • 1
    I think we differ here on the design side. Giving endless options to make each page as good as it could be in isolation of the others is not something that I believe makes a good UX. Consistency is far more valuable for me. I will however agree that one shouldn't stick exactly to a chosen grid even at the detriment of the page.
    – JohnGB
    Commented Apr 26, 2011 at 9:59
  • There is value in consistency of a grid framework. The example of 960 is very valuable - people are used to that width and designers are used to working with it. Consistency is part of usability. Commented Apr 26, 2011 at 10:39
  • ahem… where did I state that you should design ‘pages’ in isolation of each other? I had hoped that it was clear that my statement applied to designing a system :-) But the design of a good grid system always should be guided by the content it shall be supporting. Commented May 9, 2011 at 23:01
  • @Chris In just one word: fail. (SCNR) Commented May 9, 2011 at 23:12

You should have consistency yes - but if the page is not user focused what good are multiple standard margins/padding anyways. I try and use multiples of 5 personally as it is faster to equate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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