Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
472 views
in Technique[技术] by (71.8m points)

css - Remove dotted outline from range input element in Firefox

Firefox, since version 23, natively supports the <input type="range"> element, but I couldn’t figure out how to remove the dotted outline. The following CSS has no effect:

input[type='range'], 
input[type='range']:focus, 
input[type='range']:active, 
input[type='range']::-moz-focus-inner, 
input[type='range']:-moz-focusring {
    border: 0;
    outline: none;
}

Does anyone have any idea how to fix this issue in Firefox?

Example: https://jsfiddle.net/pF37g/

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Unfortunately, you can't! (update; you now can)

It's a bug in Firefox and there is no work-around to fix this besides from fixing the source base itself (see below).

Also see Jonathan Watt's blog (who is working on this):

Known issues:

  • the default CSS styled appearance still needs work, and native theming (giving the slider the appearance of the operating system's theme) is still to come ...

In a reply to a comment in his blog about this very same issue he states:

Right now you can't - sorry. I've filed bug 932410 to make that possible.

At the moment of writing there appear to be no progress on this and it's not known when a official fix will be available.

Update

Since this answer was posted the bug has been fixed. You can now use (as stated in other answers, but I include it here for completeness):

input[type=range]::-moz-focus-outer {
    border: 0;
    }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...