contenteditable DIV在FF和Chrome中有默认边框 - 如何隐藏它?

Pla*_*own 11 html javascript css firefox google-chrome

Chrome - 11.0.696.50
FF - 4.0
IE - 7.0.570.13

DIV定义如下,当我用jQuery专注于它时.
一旦我专注于它,在FF和Chrome中DIV周围都会出现边框.

FF显示虚线边框,Chrome显示实心浅橙色边框.

我试过了,border: none;但这并没有什么不同.有任何想法吗 ?

DIV: <DIV id="editable-div" contentEditable="true"></DIV>

它的CSS:

#editable-div
{
margin-left: 10px;
margin-top: 10px;
width: 740px;
height: 25px;
border: none;
direction: ltr;
text-align: left;
}

Pau*_*her 40

你所看到的可能是一个轮廓,而不是技术上的边界.试试这个:

#editable-div:focus {
    outline: none;
}
Run Code Online (Sandbox Code Playgroud)

这对我来说是黑暗中的一种射击; 希望如果它不能以这种方式工作,至少它会帮助你找到一个解决方案.