Remove dotted line around clicked button
that's the focus. Among other things it is important for accessibility (it shows what element is currently selected/has been clicked), so actually you shouldn't remove it.
If you still want to remove it, add this to your stylesheet:
:focus {
outline: none !important;
}
how to remove the dotted line around the clicked a element in html
Use outline:none
to anchor tag class
How to remove the Dotted Border on clicking?
Possible with pure HTML as well:
<a href="..." hidefocus="hidefocus">...</a>
And with JavaScript you can do that on all links:
window.onload = function WindowLoad(evt) {
//hide focus:
var arrLinks = document.getElementsByTagName("a");
for (var i = 0; i < arrLinks.length; i++) {
arrLinks[i].hideFocus = "true";
}
How do I remove the dotted line on my image button when I click it in firefox?
Try this:
button::-moz-focus-inner {
border:0;
}
button
can be replaced with whatever selector for which you want to disable the behavior.
P.S: It also works without a selector by just using ::-moz-focus-inner
.
JSFiddle Demo
Dotted border around link?
That's the focus
state. Try to add this:
a:focus {
outline: none;
}
Or if that element isn't a real link, but for example just an li
, make that
li:focus {
outline: none;
}
How to remove the dotted white border around focused button text
These styles are declared at the UA level, so each browser has their own implementation (and in Firefox case, pseudo elements for targeting them).
In Firefox, you can use the ::-moz-focus-inner
pseudo element:
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner {
border: none;
}
Related Topics
How to Get CSS to Select Id That Begins with a String (Not in JavaScript)
How to Center Buttons in Twitter Bootstrap 3
Use Excel Vba to Click on a Button in Internet Explorer, When The Button Has No "Name" Associated
Multiple Submit Buttons on HTML Form - Designate One Button as Default
How to Trigger HTML Button When You Press Enter in Textbox
How to Style Radio Buttons with Images - Laughing Smiley for Good, Sad Smiley for Bad
Why Is "&Reg" Being Rendered as "®" Without The Bounding Semicolon
Can You Tab Through All Radio Buttons
Bootstrap Full-Width Text-Input Within Inline-Form
How to Validate Pattern Matching in Textarea
How to Extract Data from HTML Table in Shell Script
What Is Aria-Label and How to Use It
CSS Hide Scroll Bar If Not Needed
How to Make Firefox Auto-Refresh on File Change
PHP Mail() - How to Put an HTML Link in an Email
Bad Value X-Ua-Compatible for Attribute Http-Equiv on Element Meta