lalalaaaa
2016-11-05 20:53
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> #div1{ width: 100px; height: 100px; background-color: #000000; } #div2{ width: 100px; height: 100px; background-color: #0000FF; } </style> </head> <body> <div id="div1"></div> <div id="div2"></div> </body> </html>
两个层的css都加入:float:left(左对齐)
#div1{ width: 100px; height: 100px; background-color: #000000; float: left; } #div2{ width: 100px; height: 100px; background-color: #0000FF; float: left; }
HTML5小游戏---爱心鱼(上)
92350 学习 · 551 问题
相似问题