Remove blue border from open <details> element in Chrome?

泪湿孤枕 提交于 2019-12-09 14:08:58

问题


I'm upgrading my site to use the new HTML5 details element for better accessibility.

It's all working OK, but unfortunately when I click to open the element, Chrome applies an ugly blue border:

Is there any way I can stop Chrome doing this? I can't see any explicit CSS styles being applied, so I'm not sure how to get rid of it.

JSFiddle code here to demo the problem: http://jsfiddle.net/6x2Kc/


回答1:


Use outline:none;

For Instance,

summary{
  outline:none;
}

WORKING DEMO

Hope this helps.




回答2:


Use outline: 0;

summary:focus {
     outline: 0;
}


来源:https://stackoverflow.com/questions/21092055/remove-blue-border-from-open-details-element-in-chrome

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