Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS When clicked, absolute-positioned link loses positioning and link isn't followed Reply To: When clicked, absolute-positioned link loses positioning and link isn't followed

#249918
mpavey
Participant

OK, I realized the way to debug this was to use the options to toggle pseudo-states to make the element active. Sure enough, that revealed that there was some styling of active links setting position: relative and top: 1px. For statically positioned elements this has the intended effect of moving them one pixel down while they are being clicked on… but for elements that are absolutely positioned, of course it has the effect of moving them to one pixel down from where they would have appeared had they originally been statically positioned!

I’ve updated the CodePen in case anyone’s curious to see it for themselves.

The thing I still find surprising is that the link is not followed. It seems this must be because the link is no longer under the mouse by the time the mouse button is released. (Selecting the link with the mouse by right-clicking then hitting the Escape key, and then hitting Enter, does follow the link.)