border、margin、padding属性的区别
2014-04-20 18:06
411 查看
可以先看下这个视频教程:http://my.tv.sohu.com/us/97014746/64226777.shtml
本文参考:http://www.cnblogs.com/chinhr/archive/2008/06/20/1227084.html
http://www.cnblogs.com/time-is-life/archive/2008/01/21/1046817.html
http://www.cnblogs.com/tianyue3107/archive/2009/04/22/1441358.html
Margin 与 Padding 的区别
1.Margin
用来设置页面中一个元素所占空间的边缘到相邻元素之间的距离.
2.Padding
用来设置元素内容到元素边界的距离。
本文参考:http://www.cnblogs.com/chinhr/archive/2008/06/20/1227084.html
http://www.cnblogs.com/time-is-life/archive/2008/01/21/1046817.html
http://www.cnblogs.com/tianyue3107/archive/2009/04/22/1441358.html
Margin 与 Padding 的区别
1.Margin
用来设置页面中一个元素所占空间的边缘到相邻元素之间的距离.
2.Padding
用来设置元素内容到元素边界的距离。
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .list1 { width:580px; height:50px; background-color:Red; margin-bottom:100px; padding-left:10px; padding-right:10px; padding-top:10px; } .list2 { width:600px; height:60px; background-color:Green; } </style> </head> <body> <form id="form1" runat="server"> <div id="div1" class="list1"> Div1这里 width:580px;需要用600px-10px-10px( padding-left; padding-right),才能DIV2的600px保存一致。<br/> Div1这里 height:60px;需要用60px-10px(减除 padding-top的内边距距离),才能高度和DIV2的60ox保持一致。 </div> <div id="div2" class="list2"> 我的 width:600px; height:30px; </div> </form> </body> </html>
相关文章推荐
- 边框(border)边距(margin)和间隙(padding)属性的区别
- border、margin、padding属性的区别
- Margin、Border、Padding属性的区别和联系
- 边框(border)边距(margin)和间隙(padding)属性的区别
- border,margin,padding属性之间的区别
- JS属性 ClientTop,scrollTop,offsetWidth,ClientWidth,clientLeft,padding,border,top,margin区别
- CSS中的border,margin和padding属性区别
- border、margin、padding属性的区别
- 边框(border)边距(margin)和间隙(padding)属性的区别
- 边框(border)边距(margin)和间隙(padding)属性的区别
- 边框(border)边距(margin)和间隙(padding)属性的区别
- 学习笔记之CSS padding margin border属性详解
- 从零开始学_JavaScript_系列(六)——CSS的padding、margin、border属性超详细解释(图文)
- 图解CSS的padding,margin,border属性(详细介绍及举例说明)
- CSS padding margin border属性详解
- CSS padding margin border属性详解
- CSS padding margin border属性详解
- CSS padding margin border属性详解【转载】
- CSS padding margin border属性详解
- margin, padding,border之间的区别