Changing link underline color

后端 未结 10 2436

I wonder if there is any trick to solve this problem.

I have my link as below text and want to change the underline color.

This link contains in many

10条回答
  •  不知归路
    2020-12-16 10:48

    If what you mean is a different underline color than what the text is, the only thing I can think of is to add a span around the link:

    
        this just
    a test
    of underline color

    And then the CSS:

    span.underline { 
        color: red; 
        text-decoration: underline; 
    } 
    span.underline a { 
        color: blue; 
        text-decoration: none; 
    } 
    

    And you get what you want.

    EDIT:

    Testing this a little further, it is not working for me on IE. If you add border-bottom, however, it surprisingly does work in all browsers, except that IE does not put a border under the last one. I will try to dig a little deeper to see if there's a cross-browser way to do this...

提交回复
热议问题