61,112
社区成员
发帖
与我相关
我的任务
分享
<div id="1" style=" height:40px; width:500px;">
<div id="2" style=" height:20px;width:50px;">中间1</div>
<div id="3" style=" height:20px; width:50px;">中间2</div>
<div id="4" style=" height:20px; width:50px;">中间3</div>
</div>
[code=css]
[/code]
.left
{
float:left;
width:33%;
margin:20px auto;
}
<div id="1" style=" margin:0 auto; width:500px;height:60px;background:#900; text-align:center;">
<div class="left" ><div id="2" style=" width:50px; height:20px; background-color:Red; ">中间1</div> </div>
<div class="left" ><div id="3" style=" width:50px; height:20px; background-color:Yellow; ">中间2</div> </div>
<div class="left" ><div id="4" style=" width:50px; height:20px; background-color:Gray;">中间3</div></div>
<html>
<head>
<style>
.left{
float:left;
width:33%;
}
</style>
</head>
<body>
<div id="1" style=" height:40px; width:500px;">
<div class="left" id="2" style=" height:20px;">中间1</div>
<div class="left" id="3" style=" height:20px;">中间2</div>
<div class="left" id="4" style=" height:20px;">中间3</div>
</div>
</body>
</html>
<div style="left: 30px; width: 281px; position: absolute; top: 150px; height: 111px;
background-color: aqua">
</div>