Select tag inside hyperlink problem

前端 未结 2 1257
清酒与你
清酒与你 2021-01-16 06:31

I have simplified my page and here what I have:




&l         


        
2条回答
  •  天命终不由人
    2021-01-16 06:51

    The problem with your approach: everything is contained in this link element. So theoretically, a browser is right to assume that anything that gets clicked inside this A-tag is clicking the link. Even thought this may work differently for some browsers, and lead to the behaviour you would like, I would doubt that the behaviour is consistent over all user agents. Hence I don't see how there is any way to make this work reliably without getting rid of the A-element, respectively moving the A-element so its only around the image (which is the behaviour you desire):

    
       
    
    

提交回复
热议问题