当前位置: 代码迷 >> HTML/CSS >> :请CSS来帮小弟我排个版!(DIV+CSS)
  详细解决方案

:请CSS来帮小弟我排个版!(DIV+CSS)

热度:297   发布时间:2012-02-20 21:18:23.0
十万火急:请CSS高手进来帮我排个版!(DIV+CSS)
HTML代码如下:

<html>
<head>
<style   type= "text/css "   media= "screen ">

</style>
</head>

<body>

<div   id= "d1 "> AAA </div>
<div   id= "d2 "> aaa </div>

<div   id= "d1 "> BBB </div>
<div   id= "d2 "> bbb </div>

<div   id= "d1 "> CCC </div>
<div   id= "d2 "> ccc </div>

<div   id= "d1 "> DDD </div>
<div   id= "d2 "> ddd </div>

</body>
</html>

这个HTML代码的显示结果为:

AAA
aaa
BBB
bbb
CCC
ccc
DDD
ddd

现在我想让这段HTML代码的显示结果变成:

AAA         BBB           CCC             DDD

aaa         bbb           ccc             ddd

要求不改变HTML代码,只能通过CSS文件来进行排版,请CSS方面的专家来帮我一下,项目紧张我真的很急!

谢谢了!

------解决方案--------------------
try:


<body>

<div style= "float:left; ">
<div id= "d1 "> AAA </div>
<div id= "d2 "> aaa </div>
</div>

<div style= "float:left; ">
<div id= "d1 "> BBB </div>
<div id= "d2 "> bbb </div>
</div>

<div style= "float:left; ">
<div id= "d1 "> CCC </div>
<div id= "d2 "> ccc </div>
</div>

<div style= "float:left; ">
<div id= "d1 "> DDD </div>
<div id= "d2 "> ddd </div>
</div>
</body>
  相关解决方案