a:active only briefly works (during mouse click)

后端 未结 4 2071
-上瘾入骨i
-上瘾入骨i 2021-01-22 07:19

For some reason, I made it so my text (a) that is active is bolded, but it is only active when it is clicked with my mouse, when it is released from the click, it turns off and

4条回答
  •  时光取名叫无心
    2021-01-22 07:54

    There are four main states of a link: a a:hover a:active a:visited

    a - is just when it is sitting there and it has never been clicked or in the processing of being clicked.

    a:hover - this is kind of like the equivalent of a mouseover event in javascript (if you are familiar with that). when the pointer "hovers" over the link the style can be changed then.

    a:active - this styling only shows up the split second that something is clicking on the link. This pseudo class is probably the least used by the general public for this reason.

    a:visited - this styling shows up after a person clicks on a link.

    So if you are trying to change the style of a link that is noticeable, I would recommend using a different pseudo class rather than a:active.

    Hope this helps!

提交回复
热议问题