简体   繁体   中英

Why is there transparent area around my svg?

I made an svg image for on my site. When I use it though it looks like this:
具有透明背景的 svg 图像的图像
There is alot of transparent area around it where I would say it could expand.
There doesn't seem to be any transparent area in the svg image itself.
When I use a png it works fine, just with the svg it creates this blank area.
I just gave the image a red background to see where the image actually is.

This is my css:

#logo {
    position: absolute;
    left: 0;
    top: 0;
    background-color: red;
    width: 200px;
    height: 50px;
}

#logo directs to the <img> in my html:

<img src="Sources/FruityJuice Logo.svg" alt="FruityJuiceLogo" id="logo">

In Adobe Illustrator I cropped the file to the logo like Yong Pin said and that seems to have fixed it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM