How to remove blank space around SVG

后端 未结 2 795
你的背包
你的背包 2021-02-14 07:02

I have an SVG showing on a simple web page, but once I resize the image beyond a certain size (height: ~65vh) the SVG has an invisible space around it that makes the page massiv

2条回答
  •  我在风中等你
    2021-02-14 08:01

    I opened your svg on Inkscape and resized the document size to fit the content. (File -> Document Properties -> Resize page to content -> Resize page to drawing or selection)

    Output:

    
    
    
    
    
    

    Now that the svg was fixed, you can put it in your file and set the height. In this case height:70vh; (For performance reasons, it's recommended to set height and width, but it's up to you).

    #Layer_1{ /*Change svg id to a meaningful name*/
        height:70vh
    }
    
    
    
    
      
      CPU Animation / joshstroup.me
    
    
    
    
    
    
    
    
    
    
    

提交回复
热议问题