2016-10-20 69 views
6

Pracuję na stronie mojego przyjaciela i nie wiem, jak wyświetlić SVG w Firefoksie. W Edge również znika podczas zmiany rozmiaru przeglądarki.Tło SVG w firefox

http://lene.isreborn.com/ 

CSS - (muszę używać ważne, ponieważ jest to Wordpress):

header::after { 
    content:""; 
    display: block; 
    background: url(/svg-filer/header-background.svg); 
    background-size: contain; 
    background-repeat: no-repeat; 
    top: 0; 
    left:-1%; 
    width: 102% !important; 
    height: 90px !important; 
    position: absolute; 
    z-index: -1; 

    -ms-transition: top ease .5s; 
    -moz-transition: top ease .5s; 
    -webkit-transition: top ease .5s; 
    transition: top ease .5s; 
} 

header.sticky-active::after { 
    top: -20px; 
} 

SVG Plik:

<?xml version="1.0" encoding="utf-8"?> 
    <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> 
    <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
     width="100%" height="90px" viewBox="0 0 1920 90" preserveAspectRatio="none">  
    <polygon id="XMLID_3_" fill="#FFFF00" points="1,99.7 1399.2,130 1921,99.7 1921,0 1,0 "/> 
    </svg> 
+0

Co masz na myśli przez "wyświetlanie prawa SVG"? Dołączenie zrzutu ekranu i szczegółowy opis pożądanego wyniku pomoże Ci zobrazować twój problem. – Terry

+0

Rozgryzłem to, moja odpowiedź jest poniżej. - Dzięki :) –

+0

_ "(muszę używać ważnych, bo to Wordpress)" _ - masz na myśli, że nie wiesz lepiej? Na przykład o specyfice? – CBroe

Odpowiedz

1

Obraz faktycznie jest biały, prawda? W przypadku zmiany koloru wypełnienia-# 000, widać obraz:

<polygon id="XMLID_3_" fill="#000" points="1,99.7 1399.2,130 1921,99.7 1921,0 1,0 "/> 

https://jsfiddle.net/fbwsh1pf/

+0

To było tylko żółte, aby zobaczyć, gdzie jest ... Ale tak, prawdziwy kolor jest biały. :) –

2

Mam go teraz: Tło-size nie działa z „zawiera”, ale 100% 100%, Zobacz Mozilla Background rules
link do strony programu: See here

header::after { 
    content:""; 
    display: block; 
    background: url(/svg-filer/header-background.svg); 
    background-size: 100% 100% !important; 
    background-repeat: no-repeat; 
    top: 0; 
    left:-1%; 
    width: 102% !important; 
    height: 90px !important; 
    position: absolute; 
    z-index: -1; 

    -ms-transition: top ease .5s; 
    -moz-transition: top ease .5s; 
    -webkit-transition: top ease .5s; 
    transition: top ease .5s; 
} 

header.sticky-active::after { 
    top: -20px; 
}