Remove dotted outline from range input element in Firefox

前端 未结 10 953
忘了有多久
忘了有多久 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:35

    Dotted outline is not an issue, it's browser's way to show the input element is selected. What you can do is set tabIndex to -1 which will prevent your input element from taking focus on tab and, consequently, from having the outline:

    
    

    But after doing this you will lose some keyboard accessibility. It is better to have input element keyboard accessible.

    Here is the fiddle: http://jsfiddle.net/pF37g/14/

提交回复
热议问题