css的margin与padding练习
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>margin</title> <style> body{ margin:0px; } .div1{ background-color: aqua; height:300px; width:300px; border:1px solid greenyellow; /*通过margin将100X100小盒子放在300X300大盒子中间*/ padding:200px 0px 0px 200px; } .div2{ background-color: blueviolet; height:100px; width:100px; /*通过margin将小盒子放在大盒子中间*/ /*margin:100px;*/ } </style></head><body><div class="div1"> <div class="div2"></div> <!--<div class="div2"></div>--></div></body></html>
相关推荐
周公周金桥 2020-09-06
大象从不倒下 2020-07-31
AlisaClass 2020-07-19
MaureenChen 2020-04-21
xingguanghai 2020-03-13
teresalxm 2020-02-18
木四小哥 2013-05-14
SoShellon 2013-06-01
Simagle 2013-05-31
羽化大刀Chrome 2013-05-31
LutosX 2013-07-29
vanturman 2013-06-27
wutongyuq 2013-04-12
luoqu 2013-04-10
hellowzm 2020-08-18
zjuwangleicn 2020-09-04
尚衍亮 2020-06-12