Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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:

enter image description here

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/

like image 959
flossfan Avatar asked Jan 13 '14 13:01

flossfan


People also ask

How do you remove a border from an element?

Above, we have the div class to no-border class and this allow us to remove the borders from the element.

How do I get rid of the blue border on my focus button?

To remove focus around the button outline:none property is used. Outline property: Outline is an element property which draws a line around element but outside the border. It does not take space from the width of an element like border.


2 Answers

Use outline:none;

For Instance,

summary{   outline:none; } 

WORKING DEMO

Hope this helps.

like image 144
Nitesh Avatar answered Oct 07 '22 18:10

Nitesh


Use outline: 0;

summary:focus {      outline: 0; } 
like image 25
Peratchi Selvam Avatar answered Oct 07 '22 17:10

Peratchi Selvam