How to write a:hover in inline CSS?

后端 未结 23 2572
孤城傲影
孤城傲影 2020-11-21 23:15

I have a case where I must write inline CSS code, and I want to apply a hover style on an anchor.

How can I use a:hover in inline CSS inside the HTML st

23条回答
  •  逝去的感伤
    2020-11-21 23:47

    I had to avoid javascript, but could go with server side code.

    so I generated an id, created a style block, generated the link with that id. Yes its valid HTML.

    a {
      text-decoration: none;
      color: blue; 
    }
    
    a:hover {
      color: blue;
      font-weight: bold;
    }
    
    
    some link 1
    
    
    some link 2

提交回复
热议问题