2013-06-19 31 views
0

我使用兩個圖像作爲背景圖像。 (兩個引用標記)當使用兩個圖像在safari中不工作

當我只使用一個圖像時,它在Safari中起作用。當我用兩個圖像嘗試這個CSS時,不再適用於Safari。儘管在Firefox中工作。

background:透明url(../ images/quote.png)no-repeat left top, url(../ images/quote2.png)no-repeat right bottom 25px;

回答

0

這將工作:

background: url(../images/quote.png) top left no-repeat, 
      url(../images/quote2.png) right bottom 25px no-repeat; 

只能指定的背景色爲最後一個(中間)層。在這種情況下,您的transparent不是必需的。如果您正在重置其他CSS,請在此行之前輸入background-color: transparent;

請記住,這在所有瀏覽器中都不受支持。更好的選擇是將元素包裝在容器div/span中。將一個背景應用於元素,將另一個背景應用於容器div/span。

0

謝謝你的建議。我早些時候嘗試過你的div建議,但沒有成功。但是,我最終仍然使用它。只有一個似乎與Safari有關的變化。它似乎並不像我定義的定位: 右下25px不重複 具體是右邊和底邊。

這是我最終使用和它的工作。可能是flexslider相互作用的問題。不確定。但這確實奏效。再次感謝你。

.flexslider { margin: 0; padding: 0 0 0 25px; background:transparent url(../images/quote.png) no-repeat left top; } 

.flexslider .slides #test-text{ background: url(../images/quote2.png) no-repeat 345px 96px; }