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

前端 未结 2 978
耶瑟儿~
耶瑟儿~ 2021-01-30 12:35

When I set a pre element to contenteditable and put focus in it for editing, it receives a dotted border around it that doesn\'t look very nice. The border isn\'t there when foc

2条回答
  •  耶瑟儿~
    2021-01-30 12:49

    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;
    }
    

提交回复
热议问题