margin-top margin-left border

来源:转载

这篇文章说明:div盒子里套个span盒子,在span标签里设置margin-top与margin-left属性,div标签添加border-top与不添加border-top的区别


<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><style type="text/css">body {margin: 0;padding: 0;}.box1 {width: 200px;height: 200px;background-color: #aaa;border-top: 5px solid red;}span {display: block;width: 100px;height: 100px;background-color: skyblue;border: 5px solid blue;margin-top: 20px;margin-left: 40px;}</style><body><div class="box1"><span class="box2"></div></div></body></html>



分享给朋友:
您可能感兴趣的文章:
随机阅读: