在 windows 上的谷歌浏览器中,
<input type="text" style="min-width:10px;width:100%;">
正如你在这里看到的那样:
<div style="width:50px;background:red;">
<input type="text" style="min-width:10px;width:100%;">
</div>
这里不是!
<table style="background:red;">
<tr><td><input type="text" style="min-width:10px;width:100%;"></td></tr>
</table>
我正在寻找纯 css 解决方案(size="1"解决了我的问题,顺便说一句)
最佳答案
添加
cellpadding="0"
cellspacing="0"
像你的 table 一样
<table cellpadding="0" cellspacing="0" style="background:red;">
<tr><td><input type="text" style="min-width:10px;width:100%;"></td></tr>
</table>
关于google-chrome - 文本字段在表格中时忽略最小宽度......有什么解决方法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11557261/