我有一個風格非常簡單的svg圖示。 我想把這個圖示的筆劃寬度改為2px。我把svg樣式中的筆劃寬度改為2,但圖示的頂部已經被切斷了。
有誰知道如何將這個屬性設定為筆畫寬度:2,但沒有任何切口?
https://jsfiddle.net/kgpj1n06/13/
。span class="hljs-selector-class">.header__button-icon {
width: 24px;
height: auto;
}
<?xml version="1.0" encoding="UTF-8"? >
<svg xmlns="http://www.w3. org/2000/svg" class="header__button-icon" width="21""21" height="21" viewBox="1。 5 2 21 21">
<defs>
<style>. a{fill:none;stroke:#200e32;strok-lineecap:round;strok-linejoin:round;strok-miterlimit:10;strok-width:1。 5px;}</style>
</defs>/span>
<g transform="translate(2.778 2.778)">
<circle class="a"/span> cx="8。 989"/span> cy="8.989"/span> r="8. 989"></circle>>
<path class="a"/span> d="M0,0,3。 524,3.515" transform="translate(15.24 15.707)"></path>
</g>/span>
</svg>/span>
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" class="snippet-box-edit snippet-box-result" frameborder="0"></iframe>
uj5u.com熱心網友回復:
調整viewBox的大小。當你的形狀變大時,你的viewBox也需要變大,以使它包含整個擴展的形狀。
。span class="hljs-selector-class">.header__button-icon {
width: 24px;
height: auto;
}
<?xml version="1.0" encoding="UTF-8"? >
<svg xmlns="http://www.w3. org/2000/svg" class="header__button-icon" width="21""21" height="21" viewBox="1. 5 1.5 21 21.5">
<defs>
<style>. a{fill:none;stroke:#200e32;strok-lineecap:round;strok-linejoin:round;strok-miterlimit: 10;stroke-width:2px;}</style>/span>
</defs>
<g transform="translate(2.778 2.778)">
<circle class="a"/span> cx="8。 989"/span> cy="8.989"/span> r="8. 989"></circle>>
<path class="a"/span> d="M0,0,3。 524,3.515" transform="translate(15.24 15.707)"></path>
</g>/span>
</svg>/span>
<iframe name="sif2" sandbox="allow-forms allow-modals allow-scripts" class="snippet-box-edit snippet-box-result" frameborder="0"></iframe>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/320099.html
標籤:
上一篇:涉及Enum的多重繼承元類沖突
