<style>/*上下排列做法*//* #box1{ width:100px; height: 100px; background:red; float:left;}#box2{ width:200px; height: 200px; background:blue; clear:both;} *//* 第一种做法 *//* #box1{ width:300px; height:100px; border:1px black solid;}#box2{ width:100px; height:100px; background:red; float:left;} *//* 第二种做法 */#box1{ width:300px; border:1px black solid; float:left;}#box2{ width:100px; height:100px; background:red; float:left;}/* 第三种做法 *//* #box1{ width:300px; border:1px black solid; overflow: hidden;}#box2{ width:100px; height:100px; background:red; float:left;} *//* 第四种做法 *//* #box1{ width:300px; border:1px black solid; display: inline-block;}#box2{ width:100px; height:100px; background:red; float:left;} */</style>
</head>
<body><!-- 上下排列做法 --><!-- <div id&#61;"box1"></div><div id&#61;"box2"></div> --><!--第一种做法--><!-- <div id&#61;"box1"><div id&#61;"box2"></div></div>aaaaaaaaaa --><!--第二种做法--> <style>/*上下排列做法*//* #box1{ width:100px; height: 100px; background:red; float:left;}#box2{ width:200px; height: 200px; background:blue; clear:both;} *//* 第一种做法 *//* #box1{ width:300px; height:100px; border:1px black solid;}#box2{ width:100px; height:100px; background:red; float:left;} *//* 第二种做法 */#box1{ width:300px; border:1px black solid; float:left;}#box2{ width:100px; height:100px; background:red; float:left;}/* 第三种做法 *//* #box1{ width:300px; border:1px black solid; overflow: hidden;}#box2{ width:100px; height:100px; background:red; float:left;} *//* 第四种做法 *//* #box1{ width:300px; border:1px black solid; display: inline-block;}#box2{ width:100px; height:100px; background:red; float:left;} */</style>
</head>
<body><!-- 上下排列做法 --><!-- <div id&#61;"box1"></div><div id&#61;"box2"></div> --><!--第一种做法--><!-- <div id&#61;"box1"><div id&#61;"box2"></div></div>aaaaaaaaaa --><!--第二种做法--><div id&#61;"box1"><div id&#61;"box2"></div></div>aaaaaaaaaa<!--第三种做法--><!-- <div id&#61;"box1"><div id&#61;"box2"></div></div>aaaaaaaaaa --><!--第四种做法--><!-- <div id&#61;"box1"><div id&#61;"box2"></div></div>aaaaaaaaaa -->
</body><div id&#61;"box1"><div id&#61;"box2"></div></div>aaaaaaaaaa<!--第三种做法--><!-- <div id&#61;"box1"><div id&#61;"box2"></div></div>aaaaaaaaaa --><!--第四种做法--><!-- <div id&#61;"box1"><div id&#61;"box2"></div></div>aaaaaaaaaa -->
</body>