2017-03-28 37 views
0

你好我正在嘗試做一個自定義的形狀,並在其中插入一個圖像。下面是到目前爲止,我已經寫在CSS和它僅適用於Chrome瀏覽器,如何使使它在所有瀏覽器中運行跨瀏覽器自定義形狀與css

.shape-custom{ 
    width:62vw; 
    height:600px; 
    shape-outside: polygon(0 0, 100% 0, 75% 100%, 0% 100%); 
    -webkit-shape-outside:polygon(0 0, 100% 0, 75% 100%, 0% 100%); 
    shape-margin: 20px; 
    background-color: rgb(74, 161, 255); 
    clip-path: polygon(0 0, 100% 0, 75% 100%, 0% 100%); 
} 

回答

1

您應該檢查「caniuse.com」,試圖用實驗前生產風格。 http://caniuse.com/#feat=css-shapes

+0

謝謝你,似乎財產是不支持在其他瀏覽器,你可以建議一個替代這種情況下,你會如何使自定義形狀像avove –

+0

我想你可以使用svg。 –

+0

希望你能得到本教程鏈接的答案和編碼解決方案 http://tutorialzine.com/2017/03/css-triangles-without-hacks/ – Momin