2012-06-27 113 views
0

我試圖將箭頭圖像添加到我的鏈接並將其定位到中間位置。 我的鏈接也有一個背景漸變,以及即時嘗試應用背景圖像的這適用於右側。是否有可能具有漸變背景+背景圖片

CSS

#nav a.linkchildflyout:link, 
    #nav a.linkchildflyout:active, 
    #nav a.linkchildflyout:visited 
    { 
     display:block; 
     padding:0px 5px; 
     text-decoration:none; 
     background: #b95d73; /* Old browsers */ 
     background: -moz-linear-gradient(top, #b95d73 0%, #970e2e 0%, #9c1a38 0%, #910022 52%, #b95d73 100%); /* FF3.6+ */ 
     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b95d73), color-stop(0%,#970e2e), color-stop(0%,#9c1a38), color-stop(52%,#910022), color-stop(100%,#b95d73)); /* Chrome,Safari4+ */ 
     background: -webkit-linear-gradient(top, #b95d73 0%,#970e2e 0%,#9c1a38 0%,#910022 52%,#b95d73 100%); /* Chrome10+,Safari5.1+ */ 
     background: -o-linear-gradient(top, #b95d73 0%,#970e2e 0%,#9c1a38 0%,#910022 52%,#b95d73 100%); /* Opera 11.10+ */ 
     background: -ms-linear-gradient(top, #b95d73 0%,#970e2e 0%,#9c1a38 0%,#910022 52%,#b95d73 100%); /* IE10+ */ 
     background: linear-gradient(top, #b95d73 0%,#970e2e 0%,#9c1a38 0%,#910022 52%,#b95d73 100%); /* W3C */ 
     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b95d73', endColorstr='#b95d73',GradientType=0); /* IE6-9 */ 
     color: white; 
    } 

    #nav a.linkchildflyout 
    { 
     background-image: url(Images/arrow.png); 
     background-position: right center; 
     background-repeat: no-repeat; 
    } 

回答

1

是有CSS3多背景屬性。你可以這樣寫:

#nav a.linkchildflyout{ 
background:linear-gradient(top, #b95d73 0%, #970e2e 0%, #9c1a38 0%, #910022 52%, #b95d73 100%),url(Images/arrow.png) no-repeat right center; 
} 

閱讀更多http://www.css3.info/preview/multiple-backgrounds/