Strange outline when clicking contentEditable div

I am trying to create a text box that can contain several colors. I created a div and in JS did the following:

element.unselectable = 'off';
element.contentEditable = true;

Now the div is now editable, but when I click on it, it gets a weird outline. How to disable this? alt text http://www.benmccann.com/test/contentEditable.png

+3
source share
1 answer

Try setting the outline property in your CSS to "none":

<style type="text/css">
    * { outline: none; }
</style>
+4
source

Source: https://habr.com/ru/post/1723446/