怎么让一个大div里的3个小div并列

<head>
<style>
.all{
float:left;
border:solid #000 2px;
}
#out{
border:solid #F00 2px;
height:100px;
}
#left{
width:10%;
height:100%;
}
#center{
width:80%;
height:100%;
}
#right{
width:10%;
height:100%;
}
</style>
</head>
<body>
<div id="out">
<div class="all" id="left"></div>
<div class="all" id="center"></div>
<div class="all" id="right"></div>
</div>
</body>

第1个回答  推荐于2016-03-12
给你个参考

.div1
{
float:left;
width:75px;
height:20px;
}
.div2
{
width:175px;
height:20px;
float:left;
}
div3
{
width:250px;
height:50px;
clear:both;
}
<div class="div1">我是第一个div</div>
<div class="div2">我是第二个div</div>
<div class="div3">我是第三个div</div>追问

我上面设置第一个是10%第二个80% 第三个10%,只要把其中一个小2%就没问题,我想问这是哪里的原因

追答

页面元素之间有边距
边距会占用些像素

本回答被提问者和网友采纳
第2个回答  2012-09-06
既然没有帮助, 删掉了...

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网