Can't get rid of dotted outline in Firefox links?

我与影子孤独终老i 提交于 2019-12-05 15:29:00

You need to apply the styles to the <a> tag (your latter two CSS rules are wrong because you've put the <a> tag inside <img>.

This works for me:

a:active,
a:focus {
  outline: none;
  -moz-outline-style: none;
}

Or, for only inside the element with ID ul (not the best name, by the way):

#ul a:active,
#ul a:focus {
  outline: none;
  -moz-outline-style: none;
}
a:active,
a:focus {
  outline: none;
  -moz-outline-style: none;
}

works for me in FF22

outline: 0 should do it and it should be applied on the <a> element, which is not actually a child of <img />. <img /> is a child of <a> so your css should read:

#ul li a {
    outline: 0;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!