Home >Web Front-end >HTML Tutorial >Summary of the reasons why the a tag cannot be clicked after the element is absolutely positioned and the height and width are set.
After the element is absolutely positioned and the height and width are set, the reason why the a tag cannot be clicked:
1. There is no content in the element
2. The background is transparent, without any background image or color
Solution:
1. If the element is not positioned absolutely, you can use relative positioning
2. Add a transparent background image to the element
3. IE can only use background:url(about:blank) to solve it
The third method can be used normally, but there will be bugs in certain situations. For example, when dragging a layer with JS, the dragging event is on a transparent layer, and you have set other mouse cursors. At this time, dragging The cursor will flash when you move it!
Summary: Use the second method, just make a 1*1PX transparent image!