How to write a:hover in inline CSS?

后端 未结 23 3026
孤城傲影
孤城傲影 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:40

    you can write a code in various type

    first i can write this

    html

    Hello siraj 
    

    css

    .one{
      text-decoration: none;
    }
    

    you can try another way

    html

    Hello siraj
    

    css

    .one{
    text-decoration: none;
    }
    
    .one:hover{
    color:blue;
    }
    
    .one:active{
    color: red;
    }
    

    you can also try hover in jquery

    java script

    $(document).ready(function(){
      $("p").hover(function(){
        $(this).css("background-color", "yellow");
        }, function(){
        $(this).css("background-color", "pink");
      });
    });
    

    html

    Hover the mouse pointer over this paragraph.

    in this code you have a three function in jquery first you ready a function which is the basic of function of jquery then second you have a hover function in this function when you hover a pointer to the text the color will be changed and then the next the when you release the pointer to the text it will be the different color and this is the third function

提交回复
热议问题