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

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<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

posted @   logspool  阅读(1824)  评论(1编辑  收藏  举报
编辑推荐:
· 对象命名为何需要避免'-er'和'-or'后缀
· SQL Server如何跟踪自动统计信息更新?
· AI与.NET技术实操系列:使用Catalyst进行自然语言处理
· 分享一个我遇到过的“量子力学”级别的BUG。
· Linux系列:如何调试 malloc 的底层源码
阅读排行:
· 对象命名为何需要避免'-er'和'-or'后缀
· JDK 24 发布,新特性解读!
· C# 中比较实用的关键字,基础高频面试题!
· .NET 10 Preview 2 增强了 Blazor 和.NET MAUI
· SQL Server如何跟踪自动统计信息更新?
点击右上角即可分享
微信分享提示