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

后端 未结 9 1415
慢半拍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:34

    span {
         cursor:pointer;
         color:blue;
         text-decoration:underline;
    }
    

    Additionally you can use :hover pseudo-class to style the element when hovered(you can use any styles not just the ones originally used). Ex.

    span:hover {
         text-decoration:none;
         text-shadow: 1px 1px 1px #555;
    }
    

    Example

提交回复
热议问题