【问题标题】:Why does Margin Collapsing only apply to top and bottom but not left and right为什么Margin Collapsing只适用于顶部和底部而不适用于左右
【发布时间】:2016-10-12 07:46:32
【问题描述】:

在 CSS 中,margin-collapsing 行为仅适用于上下边距而不适用于左右边距的动机是什么?

【问题讨论】:

    标签: css


    【解决方案1】:

    只有块级元素的边距可以折叠,如果它们是块级元素,则它们的左侧或右侧不能有元素。

    查看以下链接了解更多信息:Why horizontal margin doesn't collapse as vertical margin?

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-03
      • 2019-01-07
      • 2013-07-17
      • 1970-01-01
      • 2018-01-21
      • 2021-04-08
      • 2013-11-26
      • 1970-01-01
      相关资源
      最近更新 更多