答案:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> body{ padding:0px; margin:0 auto; width:600px; } .01{ width:500px; float:left; height:30px; background:#CCCCCC; } .03{ width:500px; float:left; height:30px; background:#999999; margin-top:10px; } .02{ width:500px; float:left; margin-top:10px; } .02-1{ width:240px; float:left; height:30px; background:#006666; } .02-2{ width:250px; float:left; height:30px; margin-left:10px; display:inline; background:#FF3333; } .02-3{ width:240px; float:left; height:30px; background:#006666; margin-top:10px; } .02-4{ margin-top:10px; width:250px; float:left; height:30px; margin-left:10px; display:inline; background:#FF3333; } </style> </head> <body> <div class="01"></div> <div class="02"> <div class="02-1"></div> <div class="02-2"></div> <div class="02-3"></div> <div class="02-4"></div> </div> <div class="03"></div> </body> </html>
上一个:在html源代码中用正则表达式截取特定的一段<div>标签的内容
下一个:HTML DIV隐藏显示问题!关于浏览器