改变el-button的样式


element-ui为我们提供了几种颜色的按钮,只需要设置 type属性就可以达到对应效果

 

 

<el-button>默认按钮</el-button>

<el-button type="primary">主要按钮</el-button>

<el-button type="success">成功按钮</el-button>

<el-button type="info">信息按钮</el-button>

<el-button type="warning">警告按钮</el-button>

<el-button type="danger">危险按钮</el-button>

 

 

如果我们想要更多颜色的按钮可以设置以下样式

<el-button class="set-other-btn">按钮</el-button>


.set-other-btn{
  color: #fff;
  background-color: #FA4EAB;
  border-color: #FA4EAB;
}
.set-other-btn:hover {鼠标悬浮
background-color: #FE83C6; border-color: #FE83C6; }

.set-other-btn:focus {鼠标点击
  background-color:  #FE83C6;
  border-color:  #FE83C6;
}

 

 

如果按钮使用了disabled属性,那么还要加入以下样式

.set-other-btn.is-disabled{
  background-color: #FE83C6;
  border-color: #FE83C6;
}
.set-other-btn.is-disabled:hover{
  background-color:  #FE83C6;
  border-color:  #FE83C6;
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM