簡體   English   中英

如何從路徑中放大和 SVG 而不是添加寬度和高度?

[英]How to scale up and SVG from with in path instead of adding width and height?

我在下面的代碼中有這個圖標,這個圖標的問題是它有一個很大的邊距,在我的情況下,我希望它的邊距更小,或者圖標更大,而不是增加您將在代碼中看到當前實現的一般大小。 任何想法如何實現這一點我嘗試了一些解決方案,但沒有一個奏效。

 import { ReactComponent as icon } from '../../Img/icon.svg'; // style const iconStyle = { padding: 0, marginTop: -5, backgroundColor: '#ef6c00', fill: 'white', }; // inside the component <icon style={iconStyle} width='24' height='24' />

您可以在編輯器中打開 svg 並直接編輯 svg 標簽。 例如這里是圓圈 svg:

<svg height="100" width="100">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />  
</svg> 

暫無
暫無

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

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