代码改变世界

多个DIV并排在一行的方法

2013-08-07 17:39  focusdada  阅读(886)  评论(0编辑  收藏  举报
<html>
<head>
<title>一种3个DIV并排在一行的方法</title>
<style type="text/css">
#bottom {
margin:0 auto;
width:300px;
}
#bottom div {
width:100px;
}
#d1 {
float:left;
background:#f00;
}
#d2 {
float:right;
background:#0f0;
}
#d3 {
float:right;
background:#00f;
}
</style>
</head>
<body>
<div id="bottom"><div id="d3">d3</div><div id="d1">d1</div><div id="d2">d2</div></div>
</body>
</html>