CSS, nested divs & margins vs. padding

后端 未结 7 2174
攒了一身酷
攒了一身酷 2021-01-13 16:10

i totally understand the box model. this question is more about trying to pin down a semantic methodology regarding when to use margins and when to use padding.

her

7条回答
  •  鱼传尺愫
    2021-01-13 16:26

    This is a bug in css, here are examples:

    http://creexe.zxq.net/div-issue-padding.html = padding issue

    http://creexe.zxq.net/div-issue-margin.html = margin issue

    the red and green div tags in the examples were created by the css property TOP,but it has its own disadvantages athat TOP,BOTTOM etc works only when the position of the div tag is Absolute and relative, but not static

提交回复
热议问题