• 技术文章 >Web开发 >css教程

    css边距重叠是什么

    小妮浅浅小妮浅浅2021-09-18 09:28:47原创2745

    1、边界重叠是指两个或两个以上盒子的相邻边界重合在一起,构成单一边界。

    可以相邻也可以嵌套,其中没有非空内容、补白、边框。

           .neighbor{
    height: 100px;
    background: red;
    }
    .father{
    background: #f436365e;
    }
    .child{
    height: 100px;
    margin-top: 10px;
    background: #00800047;
    }
    <div>
    this is neighbor
    </div>
    <div>
    <div>
    this is child
    </div>
    </div>

    2、这两个或两个以上块级盒的垂直邻接边界重合,其边界宽度为相邻边界宽度的值。

    请注意,水平线不重合。

    <style type="text/css">
    .father{
    background: #f436365e;
    overflow: hidden;
    }
    .child{
    height: 20px;
    margin: 30px auto 30px;
    background: #00800047;
    }
    </style>
    <div>
    <div>
    this is child1
    </div>
    <div>
    this is child2
    </div>
    <div>
    this is child1
    </div>
    </div>

    以上就是css边距重叠的介绍,希望对大家有所帮助。更多css学习指路:css教程

    本文教程操作环境:windows7系统、css3版,DELL G3电脑。

    专题推荐:css边距重叠
    品易云
    上一篇:CSS设计模式之ITCSS的介绍 下一篇:css中a标签伪类如何使用

    相关文章推荐

    • css中hack的原理• css中hack的3种表现形式• css中link和@import的区别• python中pyquery的CSS选择器用法• CSS简单常用属性的总结• CSS有哪些高级选择器• CSS伪类选择器是什么• CSS超链接a标签的状态• CSS背景颜色的表示方法• css中有哪些类型的样式表• css module解决命名冲突• css global在类名的应用• CSS设计模式之ITCSS的介绍

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网