CSS练习 自定义按钮样式
<button className='add-usr-btn'>
<i class="add-usr-icon"></i>
<span class="add-usr-text">添加新用户</span>
</button>
.top-btn {
background-color: #388dff;
color: #fff;
border: 0px;
border-radius: 4px;
font-size: 12px;
cursor: pointer;
}
.add-usr-btn {
.top-btn();
padding: 5px 10px;
display: flex;
align-items: center;
.add-usr-icon {
display: inline-block;
width: 12px;
height: 12px;
padding: 0px;
background-size: cover;
background-position: center center;
margin-right: 5px;
background-image: url(./assets/add_usr.png);
}
.add-usr-text {
display: block;
text-align: center;
}
}
.add-usr-btn:hover {
background-color: #61abff;
}
}