3个同一行div的摆放div

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>3个同一行div的摆放div</title>
 </head>
 <body>
 <div style="width:100%;height:200px;border:1px solid red;margin:50px 0px;">
<div style="width:300px;height:100px;border:1px solid red;float:left;">我是left div标签</div> 
<div style="width:300px;height:100px;border:1px solid red;float:right;">我是right div标签</div>
<div style="width:300px;height:100px;border:1px solid red; margin:0px auto;">我是center div标签</div>
</div>
 </body>
</html>

  

 

如果同一行要摆放5个div则在3个的基础上通过float:right/left;  margin进行控制

posted @ 2015-08-29 22:21  白色的回忆  阅读(1395)  评论(0编辑  收藏  举报