当覆盖 contentEditable 面板的样式时,我发现 css 选择器正在向我的根 contentEditable 节点添加一个 css 可选择的“焦点环”
:-moz-focusring:not(input):not(button):not(select):not(textarea):not(iframe):not(frame):not(body):not(html) { outline: 1px dotted;}
尝试以下变体:
-moz-focusring or -moz-focusring[contentEditable='true']
您可能需要上述样式:
background: rgba(0,0,0,0);
resize:none;
但是,您可能需要通过萤火虫查找 -moz 特定的调整大小参数来禁用。
对于跨浏览器样式表测试,只需浏览到这个测试数据 url:
data:text/html,<div style='position:absolute;left:100;top:50;width:200;height:300;background-color:rgb(50,50,80)'><div contenteditable>Test<br/>Test </div></div> <style contenteditable>head, title, style {display: block;} :-moz-focusring{background: transparent}</style>