Is it OK to have an empty anchor tag?

前端 未结 5 1212
庸人自扰
庸人自扰 2021-01-11 19:02

I know that I can do the following if I want to turn an image into a click-able link:



        
5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-11 19:33

    It's valid, but it's best if you did put something in there and used something like

    font-size: 0;
    

    to hide it away. This way, if someone does not have CSS (screen readers for example), he would still be able to tell approximately what the link is about.

    Here's a great article on the subject

提交回复
热议问题