<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> </head> <style> .all{ width:500px; height:500px; margin:0 auto; background-color:#000; } .one{ height:100px; background-color:#89E1BF; } .two{ height:100px; background-color:#DEE099; } .three{ height:100px; background-color:#D7A1CE; } </style> <body> <!--父div,all是黑色--> <div class="all"> <!--子div,one是绿色--> <div class="one"> </div> <!--子divtwo,是黄色--> <div class="two"> </div> <!--子div,three是紫色--> <div class="three"> </div> </div> </body> </html>
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css-jiaocheng/tc58582.shtml