div 宽度问题 (高手解答)
江左梅郎1 2011-02-21 10:20:34 小弟新写了一个DIV css 如下
.div270 {
height: 36px;
width: 282px;
margin-top: 0px;
margin-left: 0px;
float: left;
}
前端为
<div class="div270">
<p class="txt2zi">
<input name="" type="text" />
<p class="imgbumen"></p>
</div>
.txt2zi
{
margin-top: 10px;
margin-left: 16px;
float:left;
}
.imgbumen {
background-image: url(../img/bumen_0132.png);
float: left;
height: 32px;
width: 32px;
margin-top: 5px;
margin-left: 17px;
}
input
{
font-family: "新宋体", "宋体";
font-size: 14px;
color: #006699;
border: 1px solid #BFDFFF;
background-color: #F6F6F6;
height: 20px;
width: 215px;
font-style: normal;
line-height: 20px;
}
请高手帮我解答 为什么? 16+215+2(input border)+17+32=282
却溢出了呢? div 宽度改为284 就没事了呢? 多出的2px 哪来的呢?