Title tooltip is not shown when span is child of anchor

后端 未结 2 1574
南笙
南笙 2021-01-21 00:10

For example, consider the following DOM structure.


  

        
2条回答
  •  一整个雨季
    2021-01-21 00:31

    Even though the span which is a child of anchor has some minimum height because of the text it holds, the anchor as such doesn't has any height in IE. Because of this, whenever you hover over the text, the tooltip doesn't appear. To verify the same, execute the following code snippet in console

    document.getElementById("element's id").offsetHeight // will return 0
    

    This is a bug in IE and workaround would be to do something like following:

    a[title] span {
        display: inline-block;
    }
    

提交回复
热议问题