50766

Why doesn't :active or :focus work on text links in webkit? (safari & chrome)

I think I'm overlooking something, call it a long day, but why isn't this working? The styles found in the "li a:active, li a:focus" persist in Firefox and IE but not webkit. Does webkit only support the :focus pseudo class on form elements?

#footer ul li a { color: #fff; display: block; font-size: 95%; padding: 15px 15px 10px; text-decoration: none; } #footer ul li a:hover { color: #f00; } #footer ul li a:active, #footer ul li a:focus { border-top: 1px #f00 solid; color: #f00; padding-top: 14px; } #footer ul li a:focus:hover { cursor: default; }

Answer1:

The :focus pseudo class is meant for form elements, so the Webkit implementation does not apply it to other elements unless a tabindex attribute is added to the tag. http://nemisj.com/focusable/

Answer2:

Actually, the anchor element not being mouse-focusable is a long-standing bug, see https://bugs.webkit.org/show_bug.cgi?id=26856 for the reference.

Recommend

  • Changing div heights using CSS grid
  • How to set div exactly in the center of screen whose size is changing dynamically
  • Javascript - Infinite scroll JSON array?
  • How to parse labeled values of columns into a Pandas Dataframe (some column values are missing)?
  • dojo 1.9: what annotation does declare.safeMixin add?
  • how to display content from database in codeigniter without calling controller from view?
  • Position absolute not working inside position fixed
  • Angular transclude in a directive containing a ng-template (generic Confirm Modal)
  • date: illegal option — d, Find difference between two dates
  • Can't delete li from to-do list
  • Creating a Multi-Step Modal Using Jquery
  • is it possible to insert a line break in this tooltip?
  • Get the number 18437736874454810627
  • Adjust width of select element according to selected option's width
  • Custom validator control occupying space even though display set to dynamic
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • Change multiple background-images with jQuery
  • Algorithm for a smudge tool?
  • Recording logins for password protected directories
  • Using jQuery closest() method with class selector
  • Why HTML5 Canvas with a larger size stretch a drawn line?
  • How reduce the height of an mschart by breaking up the y-axis
  • MySQL WHERE-condition in procedure ignored
  • How to apply VCL Styles to DLL-based forms in Inno Setup?
  • Change an a tag attribute in JavaScript based on screen width
  • When should I choose bucket sort over other sorting algorithms?
  • ActionScript 2 vs ActionScript 3 performance
  • To display the title for the current loaction in map in iphone
  • jQuery tmpl and DataLink beta
  • Web-crawler for facebook in python
  • Jquery - Jquery Wysiwyg return html as a string
  • Unanticipated behavior
  • Traverse Array and Display in markup
  • SQL merge duplicate rows and join values that are different
  • trying to dynamically update Highchart column chart but series undefined
  • Proper way to use connect-multiparty with express.js?
  • How to set the response of a form post action to a iframe source?
  • Android Google Maps API OnLocationChanged only called once
  • Observable and ngFor in Angular 2
  • java string with new operator and a literal