您的位置:首页 > Web前端 > CSS

CSS盒子

2016-07-18 18:27 375 查看


 padding 内边距

#box{width:440px; height:240px;border:1px solid black;

padding:30px 30px 10px 30px;

}

注意:

内边距相当于给一个盒子加了填充厚度会影响盒子大小

padding: top right bottom left;

 margin 外边距

#box2{width:300px; height:100px; background:yellow;

margin:0 auto;}

/*

margin-right:auto;

margin-left:auto;

*/
注意:

外边距复合:margin: top right bottom left;

上下外边距会叠压;

父子级包含的时候子级的margin-top会传递给父级
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: