How to get the cursor to change to the hand when hovering a <button> tag

前端 未结 4 2001
小鲜肉
小鲜肉 2021-02-02 05:09

When viewing my site, the cursor only changes to the gloved hand for tags, not

4条回答
  •  日久生厌
    2021-02-02 05:40

    see: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor

    so you need to add: cursor:pointer;

    In your case use:

    #more {
      background:none;
      border:none;
      color:#FFF;
      font-family:Verdana, Geneva, sans-serif;
      cursor:pointer;
    }
    

    This will apply the curser to the element with the ID "more" (can be only used once). So in your HTML use

    
    

    If you want to apply this to more than one button then you have more than one possibility:

    using CLASS

    .more {
      background:none;
      border:none;
      color:#FFF;
      font-family:Verdana, Geneva, sans-serif;
      cursor:pointer;
    }
    

    and in your HTML use

    
    
    

    or apply to a html context:

    input[type=button] {
      background:none;
      border:none;
      color:#FFF;
      font-family:Verdana, Geneva, sans-serif;
      cursor:pointer;
    }
    

    and in your HTML use

    
    
    

提交回复
热议问题