What is the default style of the blue focus outline in Chrome?

后端 未结 3 1762
终归单人心
终归单人心 2021-02-03 19:16

I have a webapp that uses contenteditable div\'s. I like how they appear in Chrome: when I focus, Chrome displays a nice blue glow around the div. However in Firefox I get an ug

3条回答
  •  面向向阳花
    2021-02-03 19:43

    This fiddle gives a good approximation, you may want to tweak to get closer to what you're specifically after though.

    HTML

    Edit Me

    CSS

    div[contenteditable=true] {
        width:200px;
        border:2px solid #dadada;
        border-radius:7px;
        font-size:20px;
        padding:5px;
        margin:10px;    
    }
    
    div[contenteditable=true]:focus { 
        outline:none;
        border-color:#9ecaed;
        box-shadow:0 0 10px #9ecaed;
    }
    

提交回复
热议问题