关于i 标签盛放背景图像

1.html部分

<div class="hover right">
    <i class="log_change state_psd"></i>
</div>

2.css部分

.log_change{
  display: inline-block;
   50px;
  height: 40px;
  margin-top: 10px;
}
.state_psd{
  background:url(../images/密码修改.png) no-repeat center;
}

注意:  i标签需显示为块级元素,加上宽高属性占位

display: inline-block;
50px;
height: 40px;

类似img标签,宽高属性按照规范是需要赋值,先占位

原文地址:https://www.cnblogs.com/yigexiaojiangshi/p/6964181.html