Css 在IE7中,TD内的输入在右边框后渲染
IE7中的样式有问题。 使用这种css样式Css 在IE7中,TD内的输入在右边框后渲染,css,internet-explorer-7,Css,Internet Explorer 7,IE7中的样式有问题。 使用这种css样式 table td { padding: 5px; background-color: #EEE; border: solid 1px #777; } .forty-wid { width:40px; } input { width:100%; } 显示我的td的两个边框。经过仔细检查,似乎 <td class="forty-wid"> <input type="text" value="0
table td
{
padding: 5px;
background-color: #EEE;
border: solid 1px #777;
}
.forty-wid
{
width:40px;
}
input
{
width:100%;
}
显示我的td的两个边框。经过仔细检查,似乎
<td class="forty-wid">
<input type="text" value="0" />
</td>
在右边框后渲染。有人知道解决这个问题的方法吗
编辑:在使用JSBin进行测试后,发现上一个td与下一个td重叠。事情是这样的
Border-left-1 TD1 Border-left-2 Border-right-1 TD2 Border-left-3
这似乎是由于我的输入宽度:100%
在处取样,尽管在这方面花了整整一刻钟的时间 在IE7/IE8/Firefox 3/Chrome dev/Opera上,我唯一能让它看起来更接近正确的方法就是使用它(主要是因为我最终使用了一些无关的
)HTML/CSS:
H
氢
H3
H4
此处文本
我对这个不太满意,也许其他人可以帮忙?如果没有,我以后可能会花更多的时间在这方面。如果你能举个例子,它可能会帮助你更快地得到答案。哦。。好啊谢谢你的提示。我不知道JS-Bin。还有一个通常是首选的,但是JSFIDLE禁用“Compatibility View”按钮在IE8/7模式之间切换,所以我要求在这里输入JS-Bin.Nice。这个网站相当漂亮。更新了我的问题我不明白为什么,但添加那些div确实有效。比完全删除右边框要好(将其用作临时修复)。我会让它开一会儿。也许有人能想出办法。谢谢
table {
border-collapse: collapse;
table-layout: fixed
}
.forty {
width: 40px
}
input {
width: 100%
}
table td {
background-color: #eee;
border: solid 1px #777
}
table th {
color: #222;
padding: 6px 5px;
text-align: left;
background-color: #7f99b0;
border: solid 1px #888
}
table div {
margin: 6px 5px 6px 0; padding: 0 5px 0 5px
}
<div class="container">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th class="forty">
H
</th>
<th>
H2
</th>
<th>
H3
</th>
<th>
H4
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div><input type="text" value="0" /></div>
</td>
<td>
<div>Text here</div>
</td>
<td>
<div><input type="text" /></div>
</td>
<td>
<div><input type="text" /></div>
</td>
</tr>
</tbody>
</table>
</div>