删除焦点下拉菜单的虚线边框/轮廓
如何删除从下拉菜单中选择项目时显示的虚线边框/轮廓?
您可以看到显示了一个虚线边框/轮廓,我想删除它(在 Firefox 中拍摄的屏幕截图) )。
尝试下面的解决方案并没有删除它:
select:focus, option:focus, select::-moz-focus-inner, option::-moz-focus-inner {
outline: none;
border: none;
}
HTML 只是这样:
<select name="order">
<option value="desc">Newest to oldest</option>
<option value="asc">Oldest to newest</option>
</select>
How do you remove the dotted border/outline that is shown when selecting an item from a dropdown menu?
You can see there is a dotted border/outline shown, I want to remove this (screenshot taken in Firefox).
Trying the solution below did not remove it:
select:focus, option:focus, select::-moz-focus-inner, option::-moz-focus-inner {
outline: none;
border: none;
}
The HTML is just simply this:
<select name="order">
<option value="desc">Newest to oldest</option>
<option value="asc">Oldest to newest</option>
</select>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将以下内容添加到您的样式表中。 -
一直为我工作,希望它有帮助!
Add the following to your stylesheet. -
Has always worked for me, hope it helps!
在 Windows 7 和 IE9 上,不显示边框/轮廓,而是显示蓝色背景。蓝色背景和您的情况下的边框/轮廓由操作系统管理。我怀疑你用的是Mac?
从 FF 中的选择框中删除轮廓
如何删除 Firefox 的虚线轮廓按钮以及链接?
On windows 7 and IE9 no border/outline is shown, Instead a blue background is shown. The blue background and in your case the border/outline is managed by the OS. I suspect your are on a Mac?
Remove outline from select box in FF
How to remove Firefox's dotted outline on BUTTONS as well as links?