google-chrome - 文本字段在表格中时忽略最小宽度......有什么解决方法吗?

标签 google-chrome css safari webkit

在 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/

相关文章:

javascript - 苹果脚本 | Javascript - 使用 Javascript 单击链接?

javascript - 拖动任何devexpress组件时如何防止其他元素突出显示?

javascript - 更改页面大小时动态重新计算选择框的鼠标位置

css - 找不到或无法读取要导入的文件 : bootstrap-sass

html - Safari中的音频标签

macos - 在 browserstack 上测试 localhost - Safari 8(在 Yosemite 上)无法打开我的网站

regex - 是否可以通过正则表达式过滤 Chrome/Firebug 网络面板?

html - 内部显示 flex 和自动高度 (100%)

jquery - 我如何强制 Firefox 重绘视频元素?

html - CSS 中的 id 和 class 有什么区别,什么时候应该使用它们?