How to create disabled state of the font awesome icons?

后端 未结 5 1831
小鲜肉
小鲜肉 2021-02-18 21:44

I am using font awesome icons and I need to have a disabled state of the icons. is there any way to do this. I am also using bootstrap.

This is how I am using icons.

5条回答
  •  青春惊慌失措
    2021-02-18 22:43

    You could define your "Bootstrap-like" disabled class

    .fa.disabled,
    .fa[disabled],
    .disabled > .fa,
    [disabled] > .fa {
      opacity: 0.5;
      /*optional*/ cursor: not-allowed;
      /*optional*/ pointer-events: none;
    }
    

    and then use it like

     
     
     
    
    

提交回复
热议问题