How do I remove the border around a focused contenteditable pre? How do I remove the border around a focused contenteditable pre? javascript javascript

How do I remove the border around a focused contenteditable pre?


Set the outline property to 0px solid transparent;. You might have to set it on the :focus state as well, for example:

[contenteditable]:focus {    outline: 0px solid transparent;}


You can also add the :read-write pseudo-class to style elements that are editable.

For instance (jsFiddle):

.element:read-write:focus {     outline: none;}

Read more here on codrops.

The :read-write pseudo-class selector is supported in Chrome, Safari, and Opera 14+, and on iOS. It is supported with the -moz- prefix in Firefox in the form :-moz-read-write. The :read-write selector is not supported in Internet Explorer and on Android.