Remove underline only from anchor element child

前端 未结 7 796
故里飘歌
故里飘歌 2020-12-10 12:02

When an a tag contains child elements, like an i tag, it\'s still applying the underline to it on hover, and I\'m wondering how to remove the under

7条回答
  •  臣服心动
    2020-12-10 12:27

    Try following css,

    a:hover i{
        display: inline-block; <-- this is the trick
        text-decoration:none !important;
    }
    

    Demo

提交回复
热议问题