I am using on my Android app a webview which loades an external page.
It has a few anchors (<a>
tags). When I press on it, yellow border appears.
How can I prevent it and remove this border ?
I've tried following tricks:
// jQuery
$("a").focus(function(){
$(this).attr("hideFocus", "hideFocus");
});
// CSS
a, :focus {
outline: none;
}
but with no success.
Thanks !
If you want to remove the focus around a button, you can use the CSS outline property. You need to set the “none” value of the outline property.
Just add a:visited { outline: none; } in your style file.
Answer: Use CSS outline property In Google Chrome browser form controls like <input> , <textarea> and <select> highlighted with blue outline around them on focus. This is the default behavior of chrome, however if you don't like it you can easily remove this by setting their outline property to none .
Set the CSS property -webkit-tap-highlight-color as follows:
* { -webkit-tap-highlight-color: rgba(0,0,0,0); }
Note: setting the color in other ways usually fails because of the way webkit renders the highlight. Depends on version/variant according to my experience.
according to this post it's better to use
a:focus,
button:focus,
input:focus,
textarea:focus {
outline: none;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With