Turn Off Alt Tags On Links With CSS?

后端 未结 6 1946
青春惊慌失措
青春惊慌失措 2021-01-17 22:19

This website that I\'m working on has annoying alt tags popping up when you hover over links in the sidebar. I didn\'t put these alt tags in. But, I can control the CSS... I

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-17 22:42

    Simple answer: no

    They are impossible to turn off just with CSS. They are browser dependant and are not part of any CSS spec i.e. you can't style them, hide them, anything.

    Though you can get rid of them by Javascript:

    Javascript

    var elements = document.getElementsByTagName('a');
    
    for (var i = 0, len = elements.length; i < len; i++)
    {
      elements[i].removeAttribute('title');
    }
    

提交回复
热议问题