顺义网站建设哪家好,低代码app开发平台,微网站是免费的吗,vs中可以用新建项目来做网站吗1. 盒子的垂直布局的注意 若两个“相邻”垂直摆放的盒子#xff0c;上面盒子的下外边距与下面盒子的上外边距会发生重叠#xff0c;称为外边距合并 若合并后#xff0c;外边距会选择重叠外边距的较大值 若两个盒子具有父子关系#xff0c;则两个盒子的上外边距会发生重叠上面盒子的下外边距与下面盒子的上外边距会发生重叠称为外边距合并 若合并后外边距会选择重叠外边距的较大值 若两个盒子具有父子关系则两个盒子的上外边距会发生重叠若改变盒子的上外边距父子盒子都会随之移动位置 三种解决办法 1. 可以为父元素添加边框 2. 可以为父元素添加内边距 3. 为父元素添加overflow: hidden; 学习完浮清除动元素的最终解决方案 .clearfix::after,
.clearfix::before {content: ;display: table;clear: both;
}示例如下
!DOCTYPE html
html langenheadmeta charsetUTF-8meta nameviewport contentwidthdevice-width, initial-scale1.0titleDocument/titlediv {width: 200px;height: 200px;}/* .box1 {background-color: #c7edcc;margin-bottom: 300px;}.box2 {background-color: #fde6e0;margin-top: 200px;} */.clearfix::after,.clearfix::before {content: ;display: table;clear: both;}.father {background-color: #c7edcc;/* border: 1px solid #000; *//* padding: 1px; *//* overflow: hidden; */}.son {width: 100px;height: 100px;background-color: #fde6e0;margin-top: 100px;}
/headbodydiv classfather clearfixdiv classson/div/div!-- div classbox1/divdiv classbox2/div --
/body/html