How to remove only underline from a:before?

后端 未结 6 1941
一整个雨季
一整个雨季 2020-12-02 12:38

I have a set of styled links using the :before to apply an arrow.

It looks good in all browser, but when I apply the underline to the link, I don\'t wan

6条回答
  •  不知归路
    2020-12-02 13:30

    You can do it adding the following to the :before element:

    display: inline-block;
    white-space: pre-wrap;
    

    With display: inline-block the underline disappears. But then the problem is that the space after the triangle collapses and is not shown. To fix it, you can use white-space: pre-wrap or white-space: pre.

    Demo: http://jsfiddle.net/r42e5/9/

提交回复
热议问题