Remove dotted outline from range input element in Firefox

前端 未结 10 984
忘了有多久
忘了有多久 2020-12-08 12:33

Firefox, since version 23, natively supports the element, but I couldn’t figure out how to remove the dotted outline. The following

10条回答
  •  忘掉有多难
    2020-12-08 13:17

    As Ken already pointed out, there is no way to remove the outline. However, there is a work-around to "hide" the outline if you know the background-color of the parent element. Assuming a white background the following CSS would hide the dotted outline:

    input[type=range] {
        border: 1px solid white;
        outline: 2px solid white;
        outline-offset: -1px;
    }
    

    Your updated example: http://jsfiddle.net/9fVdd/15/

提交回复
热议问题