While creating GUIs I've come across the "double margin" problem several times, where two elements have the same margin defined and end up being spaced twice as far apart as I intended.
One solution I use is to define the margin on only some sides of the element (for example, only on the top if I expect elements to be stacked vertically), but then I'm missing a bottom margin for the last element.
How do you deal with this problem? Examples in any language or framework are welcome.