31

I dont know if this can be fix, but I made this website and when my users click on some divs the selected div appears to have yellow border in chrome and similar border in safari. You can see the yellow border here enter image description here. Is it possible to disable this?

1
  • Can you show us the CSS that applies to these divs?
    – E.Z. Hart
    Feb 10, 2012 at 4:07

2 Answers 2

104

Try adding this in your CSS:

*:focus {
    outline: none;
}

That should get rid of the focus highlight for the whole page.

0
6

I know this is old, but for reference for others is that the div becomes selectable in Chrome once the tabIndex property is added. a trick was used to make the tabIndex negative for elements that could not be tabbed to but even then the select rectangle was shown.

1
  • This should be the accepted answer. Removing the focus outline without replacing it with an alternative hurts accessibility.
    – René
    Feb 5, 2019 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.