Jim*_*988 7 html css height input
如何使用普通css为ie8将输入字段拉伸到表格单元格的高度?
<table>
<tr>
<td>line1<br />line2</td>
<td><input type = "text" /></td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
height:100% 在输入上不起作用,也没有组合:
height:inherit;
display:inline-block;
position:relative;
Run Code Online (Sandbox Code Playgroud)
如果答案是你不能,那就没关系,我会把一些jquery放在一起做.
添加padding:0到 td 和height:100%input
input {
height:100%;
display:inline-block;
position:relative;
}
td {
border:solid green 1px;
background:pink;
padding:0;
}
Run Code Online (Sandbox Code Playgroud)