css中background和 background-color 同时使用的优先级


给背景图片设置一个默认背景颜色,有以下两种方法:

<style>
  .bg1{
  background:url(http://debug.itxst.com/img/logo.png) red no-repeat; 
    height:80px;width:1000%;
  }
  
    .bg2{
  background:url(http://debug.itxst.com/img/logo.png) no-repeat; 
    height:80px;width:1000%;
    background-color:red;
  }
  
</style>

<div class="bg1">

</div>

<div class="bg2">

</div>

 转载  http://www.itxst.com/detail/jnjvv2qu.html


免责声明!

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



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