簡體   English   中英

SVG上的填充顏色不變

[英]Fill color not changing on SVG

我有一個SVG,我正在嘗試給它提供不同的顏色。 我一直通過將十六進制顏色指定為fill選項來完成此操作。 通常這就像一種魅力,我會繼續結婚。 但是出於某種原因,我無法理解這不適用於我的SVG。 我將發布代碼並解釋更多。

SVG

    <?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="32px" viewBox="0 0 30 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
    <title>resend</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="App-Assets" stroke="#2C6D81" stroke-width="1" fill="#2C6D81" fill-rule="evenodd">
        <path d="M23.282379,28.3016743 C15.4171745,33.5297318 8.52508541,29.298172 8.52508541,29.298172 C8.52508541,29.298172 7.44663032,30.4349948 6.50599844,31.3964112 C5.56675873,32.4275162 5.1481845,32.0719627 5.00850508,30.8275258 C4.76766248,27.840877 4.27994463,22.3999616 4.27994463,22.3999616 L11.9711299,22.3999616 C13.3976235,22.3999616 14.0593605,22.755515 12.7725464,24.1426474 C11.8681106,25.2093077 10.9270146,26.3461305 10.9270146,26.3461305 C10.9270146,26.3461305 16.2872706,28.4092884 21.3681676,24.8537542 C25.056911,22.2942437 25.6499685,17.031579 25.6499685,15.9649187 C25.6499685,14.9333397 26.1028825,14.4720684 27.076462,14.4720684 L28.0152377,14.4720684 C28.9544774,14.4720684 29.4421952,15.0053986 29.4421952,15.9649187 C29.4440514,16.9239648 29.2700322,24.3204241 23.282379,28.3016743 L23.282379,28.3016743 Z M16.6696488,7.85735261 C17.5740847,6.79069235 18.5151806,5.65386954 18.5151806,5.65386954 C18.5151806,5.65386954 13.1549247,3.59071156 8.0740276,7.14624577 C4.38528426,9.70575632 3.79222677,14.968421 3.79222677,16.0350813 C3.79222677,17.0666603 3.33931275,17.5279316 2.36573324,17.5279316 L1.42695758,17.5279316 C0.487717858,17.5279316 1.86517468e-13,16.9946014 1.86517468e-13,16.0350813 C1.86517468e-13,15.1111164 0.174019217,7.71465717 6.15981622,3.69832573 C14.0250208,-1.56481303 20.9171098,2.70182801 20.9171098,2.70182801 C20.9171098,2.70182801 21.9955649,1.56500521 22.9361968,0.603588764 C23.8754365,-0.427516155 24.2940107,-0.0719627347 24.4336902,1.17247424 C24.6745328,4.15912297 25.1622506,9.60003844 25.1622506,9.60003844 L17.4710653,9.60003844 C16.0445718,9.60003844 15.3828347,9.24448502 16.6696488,7.85735261 L16.6696488,7.85735261 Z" id="resend" fill="#898989"></path>
    </g>
</svg>

如您所見,我有一個筆觸和一個填充。 怪異的部分是筆觸在起作用,但填充不起作用。 我是SVG的新手,所以我可能在做一些明顯的錯誤,但是我希望得到一些幫助,謝謝!

它非常隱蔽,但是在路徑標簽的末尾有一個fill屬性。 它比上一個優先級更高。 刪除它,它將起作用:

 <?xml version="1.0" encoding="UTF-8"?> <svg width="30px" height="32px" viewBox="0 0 30 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch --> <title>resend</title> <desc>Created with Sketch.</desc> <defs></defs> <g id="App-Assets" stroke="#2C6D81" stroke-width="1" fill="#ff0000" fill-rule="evenodd"> <path d="M23.282379,28.3016743 C15.4171745,33.5297318 8.52508541,29.298172 8.52508541,29.298172 C8.52508541,29.298172 7.44663032,30.4349948 6.50599844,31.3964112 C5.56675873,32.4275162 5.1481845,32.0719627 5.00850508,30.8275258 C4.76766248,27.840877 4.27994463,22.3999616 4.27994463,22.3999616 L11.9711299,22.3999616 C13.3976235,22.3999616 14.0593605,22.755515 12.7725464,24.1426474 C11.8681106,25.2093077 10.9270146,26.3461305 10.9270146,26.3461305 C10.9270146,26.3461305 16.2872706,28.4092884 21.3681676,24.8537542 C25.056911,22.2942437 25.6499685,17.031579 25.6499685,15.9649187 C25.6499685,14.9333397 26.1028825,14.4720684 27.076462,14.4720684 L28.0152377,14.4720684 C28.9544774,14.4720684 29.4421952,15.0053986 29.4421952,15.9649187 C29.4440514,16.9239648 29.2700322,24.3204241 23.282379,28.3016743 L23.282379,28.3016743 Z M16.6696488,7.85735261 C17.5740847,6.79069235 18.5151806,5.65386954 18.5151806,5.65386954 C18.5151806,5.65386954 13.1549247,3.59071156 8.0740276,7.14624577 C4.38528426,9.70575632 3.79222677,14.968421 3.79222677,16.0350813 C3.79222677,17.0666603 3.33931275,17.5279316 2.36573324,17.5279316 L1.42695758,17.5279316 C0.487717858,17.5279316 1.86517468e-13,16.9946014 1.86517468e-13,16.0350813 C1.86517468e-13,15.1111164 0.174019217,7.71465717 6.15981622,3.69832573 C14.0250208,-1.56481303 20.9171098,2.70182801 20.9171098,2.70182801 C20.9171098,2.70182801 21.9955649,1.56500521 22.9361968,0.603588764 C23.8754365,-0.427516155 24.2940107,-0.0719627347 24.4336902,1.17247424 C24.6745328,4.15912297 25.1622506,9.60003844 25.1622506,9.60003844 L17.4710653,9.60003844 C16.0445718,9.60003844 15.3828347,9.24448502 16.6696488,7.85735261 L16.6696488,7.85735261 Z" id="resend"></path> </g> </svg> 

這實際上已經在50分鍾前的評論中得到了回答...沒看到,對不起

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM