It is better to use in block layout margin or padding?

When working with the designer, for many blocks, within which the other sub blocks, something like:

container general { /* overall framework of the website */

div 1 {
}

div 2 {
section 2.1 {
content;
}
}
}

(sorry for the code layout generally zero)

Maybe so it is clearer:
630455467527fb7d8ea6a9965944cc84.png

How to use margin and padding if for any diva on Shrine can ask both?
Stick whether the main diva (div 1, div 2, div 3) to each other and moving child blocks/sections (1.1, 1.2...2.1, 2.2.... 3.1, 3.2)? Than margin'om top om padding'go on top? Or not touch the child and move the main (div 1, div 2 etc)

Sorry if the question is not very clear. I myself tried to understand. Read articles on Habre, cecal different sites via the console (use padding everywhere like). Just when the diva inside of div, and inside div, how best to align them?

UPD.
Simply try to formulate:

<block 1>
<content></content>
</block 1>

<block 2>
<content></content>
</block 2>


(around the white box)

For block 2 would create a margin-top or for content 2 asked margin-top/padding-top?
April 7th 20 at 15:21
2 answers
April 7th 20 at 15:23
Solution
2 margin collapse - external padding - perfect.
padding - padding. Without in any way if you want border-Ohm to circle and highlight the block.
there are still line-height - spacing. But I think with him you through the year of practice on the first two need to move on ;-)
2 margin collapse


Collapse seems to be only the previous lower and upper the next. No idea why so to use if all you can only set margin-top.

padding - padding. Without in any way if you want border-Ohm to circle and highlight the block.


How many sites looked, basically only use padding for indenting, even without border. Ie stupidly push the content within the block. - kayden_Huels commented on April 7th 20 at 15:26
@wilford.Hell,
stupid move of the content within the block.

You know, padding it for. To move the content within the block. - ashton_OKeefe34 commented on April 7th 20 at 15:29
@Eriberto_OHara, Yes, I'm asking you to move the content within the block or to push the block? - kayden_Huels commented on April 7th 20 at 15:32
April 7th 20 at 15:25
This is the same as to ask. And I eat with a spoon or fork? Everything has its place. Good layout uses both. Try the link to register inline-block and push the link on the left. You will see that the underline of a link is too long at padding. In addition to inline does not work margin-top, margin-bottom
Good layout uses both.

I think a good layout is used both with a single style. - kayden_Huels commented on April 7th 20 at 15:28

Find more questions by tags Adaptive designCSSHTMLLayout