Skip to main content

Posts

Showing posts with the label anchor-tag

Disable grey border on anchor (<a>) elements on focus

I am trying to make the ugly grey border that appears around anchor tags go away. The CSS property " outline:none; " works for Firefox, but how can I do it in IE. Preferably using CSS expressions or jquery. I'm not worried about accessibility BTW. Based on your suggestions I found these to be the best solutions... The jquery(for IE browsers): $('a').focus(function(){ $(this).blur(); }); Another jquery option(for IE browsers only): $('a').focus(function(){ $(this).attr("hideFocus", "hidefocus"); }); The CSS(For all other browsers that force an outline): a{ outline: none; } Note: Some browsers such as Google Chrome don't force an outline on focus. Source: Tips4all