我在 IE 9 中的 contenteditable div 中添加了一个文本输入字段,但输入字段可调整大小并且周围有边框,我尝试使用 CSS 修复此问题但它不起作用。 这是我的代码:
HTML:
<body>
<div id="wrapper">
<div id="input" style="border:1px solid black;height:100px;" tabindex="0" onfocus="divFocus();" onblur="divBlur();">
<p id="text" contenteditable="true">
<input type="text" id="textBox" size="3" onblur="keydown(32);" onkeypress="this.style.width = ((this.value.length + 1) * 8) + 'px';"
value="Anything" />
</p>
</div>
</div>
</body>
CSS:
#textBox
{
text-wrap:normal;
font-family:arial;
font-size:15px;
border:none;
resize:none;
border:0;
border-color: transparent;
}
#textBox:focus
{
outline: none;
outline-width: 0;
outline-color: transparent;
}
最佳答案
使用
resize:none
这将阻止输入字段调整大小
关于html - IE 9 使输入文本字段可调整大小,如何禁用它并移除它周围的边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16880835/