How do I style a span to look like a link without using javascript?

后端 未结 9 1417
慢半拍i
慢半拍i 2021-02-02 06:00

For my website I will need to use instead of , because I am using mostly ajax and thus instead of links I have onclick ajax event

9条回答
  •  余生分开走
    2021-02-02 06:28

    Option1

    Just use an anchor link as follows:

     Link 
    

    Option2

    I don't know why you would wanna use span , but if you do you can do the following styles to make it look similar to an anchor link.

    span {
        color: #000000; /* Change this with links color*/
        cursor: pointer;
        text-decoration: underline;
    }
    
    span:hover {
        color: #444444; /* Change the value to with anchors hover color*/
    }
    

提交回复
热议问题