问题描述
我添加了以下CSS代码,以摆脱单击链接HTML元素后出现的轮廓.
CSS代码:
I added the following CSS code to get rid of the outline that was appearing after click on a link HTML element.
CSS Code:
.window-leveling-btn:focus {
outline: 0;
}
然后,我收到以下csslint错误消息. 我不明白为什么我不应该这样做或者我应该如何正确地做到这一点.
错误消息:WARNING: Outlines shouldn't be hidden unless other visual changes are made. Use of outline: none or outline: 0 should be limited to :focus rules. (outline-none)
Afterwards I get the following csslint error message. I don't understand why I shouldn't be doing this or how I should do it correctly.
Error Msg: WARNING: Outlines shouldn't be hidden unless other visual changes are made. Use of outline: none or outline: 0 should be limited to :focus rules. (outline-none)
推荐答案
基本上,CSSLint团队认为您不应该这样做,因为这会使用户更难以浏览页面.
Basically, the CSSLint team believes you shouldn't be doing that because it makes it harder for users to navigate the page.
为减少错误,这取决于您在其中进行编码的应用程序(命令行或文本编辑器).根据此CSSLint GitHub问题,您可以在评论中关闭对规则的处理,应该可以涵盖大多数情况.
As for suppressing the error, it would depend on the application you're coding in (command line, or a text editor). According to this CSSLint GitHub issue you can turn off the linting for a rule in a comment, which should cover most cases.
这篇关于此csslint错误的目的是什么,如何消除该错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!