http://jsbin.com/nuzazefuwi/1/edit?html,css,output
在上面的链接中,文本框应该只有10px而不是宽度为152px.
这是代码:
.input {
width: 100%;
box-sizing: border-box;
}
.cont {
padding: 2px;
}
.main {
position: absolute;
border: 1px solid black;
min-width: 15px;
}Run Code Online (Sandbox Code Playgroud)
<div class='main'>
<div class='cont'>
<input type="text" class='input' />
</div>
</div>
<br/>
<br/>
<br/> the textbox should have 10pxRun Code Online (Sandbox Code Playgroud)
看起来输入在.main min-width大于156px 后才开始获得正确的宽度.
| 归档时间: |
|
| 查看次数: |
12929 次 |
| 最近记录: |