1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>无标题文档</title> 6 <style> 7 #box{width:200px;height:200px;background:Red;border:10px solid #000; margin:30px;} 8 #div{width:200px;height:200px;background:blue;border:10px solid #ccc;} 9 /* 10 margin 外边距(margin元素的边框之外不显示元素背景) 11 margin:10px 20px; 12 margin:10px 20px 40px; 13 margin:10px 20px 40px 60px; 14 margin-top 15 margin-right 16 margin-bottom 17 margin-left 18 */ 19 </style> 20 </head> 21 <body> 22 <div id="box"></div> 23 <div id="div"></div> 24 </body> 25 </html>
原文:http://www.cnblogs.com/hduhdc/p/5225511.html