Adding tabindex="-1" to the target of the anchors will allow default UA styling (i.e. outline).
It can also be used in lieu of :target for styling, but more importantly it should make the UA focus on the target when the anchors are activated or when the page loads with that hash (there is a default styling for :focus but there is none for :target).
Adding
tabindex="-1"
to the target of the anchors will allow default UA styling (i.e.outline
). It can also be used in lieu of:target
for styling, but more importantly it should make the UA focus on the target when the anchors are activated or when the page loads with that hash (there is a default styling for:focus
but there is none for:target
).