CSS杂记-background属性

刚在项目中遇到个问题就是我的一个日期选择的input框设置了背景色和背景图片,结果只有背景色没有背景图片,话不多说先上代码
.filter .item input[type=text] {
width: 150px;
height: 30px;
background: #fff;
border: 1px solid #C7D8E1;
outline: none;
}
.wicon {
background-image: url(../dateTime.png);
background-repeat: no-repeat;
background-position: right center;
}
CSS杂记-background属性

结果审查元素发现是background:#fff把background-image的属性给覆盖了,所以要解决这个问题只需要把第一个的background的属性改为background-color:#ffffff即可,效果图如下:
CSS杂记-background属性

相关文章:

  • 2021-05-23
  • 2022-12-23
  • 2021-08-03
  • 2021-09-15
  • 2021-11-30
  • 2021-09-17
  • 2022-12-23
  • 2021-07-21
猜你喜欢
  • 2021-06-21
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2021-08-28
  • 2022-02-20
相关资源
相似解决方案