日期:2014-05-17  浏览次数:20654 次

div问题。速度回答下呵呵
<style type="text/css">
#head { margin:5px 500px auto;width:1000px; height:300px; background:#9FF;}
#main { margin:5px 800px auto;width:700px; height:300px; background:#9FF;}
#tail { margin:5px 800px auto;width:700px; height:300px; background:#9FF;}
#left{ margin:5px 500px auto;width:300px; height:700px; background:#9FF;}
</style>
<body>
<div id="head">aaaa</div>
<div id="main">bbbb</div>
<div id="left">dddd</div>
<div id="tail">cccc</div>

这段代码中如何让bbbb与dddd平排(如果不知道平排啥意思可以这样理解。bbbb在右上角,dddd在左上角)

------解决方案--------------------
HTML code
<!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>
<title>无标题页</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.2.js'></script>
</head>
<body>
<style type="text/css">
#head { margin:5px 500px auto;width:1000px; height:300px; background:#9FF;}
#main {width:700px; height:300px; background:#9FF; float:right;}
#tail { margin:5px 800px auto;width:700px; height:300px; background:#9FF;}
#left{width:300px; height:700px; background:#9FF;float:left;}
</style>
<body>
<div id="main">bbbb</div>
<div id="left">dddd</div>
<div style='clear:both'></div>
<div id="head">aaaa</div>
<div id="tail">cccc</div>
</body>
</html>