2013-03-08 79 views
1

現在我發現這已經是SO,似乎每個人都認爲它的偉大工程How do I combine a background-image and CSS3 gradient on the same element?CSS3漸變和雪碧,同時

因爲當我這樣做,失敗某些原因。圖像獨立工作,漸變也是如此。我究竟做錯了什麼?

.cSub { 
    background: #00f; 
    background-image: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, -moz-linear-gradient(-45deg, #0088b7 0%, #006da4 100%); 
    background-image: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, -webkit-linear-gradient(-45deg, #0088b7 0%, #006da4 100%); 
    background-image: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, -o-linear-gradient(-45deg, #0088b7 0%, #006da4 100%); 
    background-image: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, -ms-linear-gradient(-45deg, #0088b7 0%, #006da4 100%); 
    background-image: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, linear-gradient(135deg, #0088b7 0%, #006da4 100%); 
    border-top: 2px solid #0089b7; 
} 

回答

2

你有background-image的財產,但你把所有爲它的背景值,只是把background而不是background-image

+0

該死的,我一定很累。謝了哥們。 – Fresheyeball 2013-03-08 05:41:40

0
.cSub {  
    background: #00f;  
    background: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, -moz-linear-gradient(-45deg, #0088b7 0%, #006da4 100%);  
    background: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, -webkit-linear-gradient(-45deg, #0088b7 0%, #006da4 100%);  
    background: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, -o-linear-gradient(-45deg, #0088b7 0%, #006da4 100%); 
    background: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, -ms-linear-gradient(-45deg, #0088b7 0%, #006da4 100%);  
    background: url("../images/header/Down_Arrow.svg") 9px 8px no-repeat, linear-gradient(135deg, #0088b7 0%, #006da4 100%); 
    border-top: 2px solid #0089b7;  
width:200px;  
height:auto  
}  

您需要以寬度和高度來顯示背景。