问答详情
源自:5-4 CSS3背景 multiple backgrounds

怎么变颜色啊 用red或者#999 这种表示也变不了颜色


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>多重背景</title>
<style type="text/css">
.demo {
    width: 300px;
    height: 140px;
    border: 1px solid #999;
    padding:30px;
    background:60,60,60,0.5 url(http://static.mukewang.com/static/img/logo_index.png)border-box padding-box no-repeat right bottom /50% 50%,
               url(http://static.mukewang.com/static/img/logo_index.png) no-repeat left top/ 80% 40% padding-box content-box ;
}
</style>  
</head>
<body>
<div class="demo"></div>
</body>
</html>

提问者:martinesk 2015-01-20 21:59

个回答

  • purple_yao
    2015-01-21 10:46:14

    <!DOCTYPE html>
    <html>
    <head> 
    <meta charset="utf-8">
    <title>多重背景</title>
    <style type="text/css">
    .demo {
        width: 300px;
        height: 140px;
        border: 1px solid #999;
        background:url(http://static.mukewang.com/static/img/logo_index.png) no-repeat, 
                   red url(http://static.mukewang.com/static/img/logo_index.png) no-repeat;
    }
    </style>  
    </head> 
    <body>
    <div class="demo"></div>
    </body>
    </html>

    上面这样是可以的,把颜色放到第二个部分。