css:

1 .div-inline{ display:inline} 

html:

1 <div class="div-inline">第一个div盒子</div>
2 <div class="div-inline">第二个盒子</div>
3 <div class="div-inline">第三个盒子</div> 

完整代码:

 1 <%@ page language="java" contentType="text/html; charset=UTF-8"
 2     pageEncoding="UTF-8"%>
 3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 4 <html>
 5 <head>
 6 <style type="text/css">
 7 .div-inline{ display:inline}
 8 </style>
 9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
10 <title>Insert title here</title>
11 </head>
12 <body>
13 <hr>
14
15 <div class="div-inline">第一个div盒子</div>
16 <div class="div-inline">第二个盒子</div>
17 <div class="div-inline">第三个盒子</div>
18 </body>
19 </html>
三个div并排
01-23 21:40