Is there a rule or guideline for writing CSS that should use margin or padding to add indents?
This question is a translation of " When to use margin vs padding in CSS "
Is there a rule or guideline for writing CSS that should use margin or padding to add indents?
This question is a translation of " When to use margin vs padding in CSS "
It is you and your designer who decide. Everything depends on the design. There are really rules in different css frameworks. But this is not something unique and unified.
So, in general, use padding for indentation inside the block, margin for omitting the block itself.
Again, depending on the pattern (or mood), you can not use these rules at all.
Source: https://ru.stackoverflow.com/questions/625045/
All Articles