html - IE 9 使输入文本字段可调整大小,如何禁用它并移除它周围的边框?

标签 html css

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

相关文章:

html - 如何避免全屏背景图像随出现的滚动条一起缩放?

javascript - CSS框宽度不变

javascript - 菜单固定在单页 - 更改颜色

asp.net - 像在 html 中一样创建具有样式和颜色的 PDF

jquery - 在调用另一个函数之前执行一些函数

javascript - 如何使用 jquery 拆分和连接字符串以获得以下结果

css - Bootstrap 菜单焦点背景颜色

javascript - 如何为 twitter bootstrap popover 设置默认属性值?

javascript - 样式化 html5 的范围控件

javascript - 查看页面时更改 CSS 代码