How do you style contentEditable in Firefox?

后端 未结 6 871
旧时难觅i
旧时难觅i 2021-01-04 12:42

I have the following:

Item 2

In webkit I can easily style this with css. Firefox is ignorin

6条回答
  •  萌比男神i
    2021-01-04 13:18

    When overriding styles for a contentEditable panel, the css selector I found that firefox was adding a css-selectable "focus-ring" to my root contentEditable node

    :-moz-focusring:not(input):not(button):not(select):not(textarea):not(iframe):not(frame):not(body):not(html) { outline: 1px dotted;} 
    

    Try variants of:

    -moz-focusring or -moz-focusring[contentEditable='true'] 
    

    You may want the aforementioned styles:

    background: rgba(0,0,0,0); 
    resize:none;
    

    But, you may need to firebug lookup the -moz specific resize parameter to disable.

    For cross-browser stylesheet tests, just browse to this test data url:

    data:text/html,
    Test
    Test

提交回复
热议问题