Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 使用CSS缩小SVG_Image_Svg_Zooming_Scale - Fatal编程技术网

Image 使用CSS缩小SVG

Image 使用CSS缩小SVG,image,svg,zooming,scale,Image,Svg,Zooming,Scale,我有一个纸飞机的SVG,我想把它放在一个圆里面。 但是,当我执行以下操作时,SVG的边缘会被裁剪。SVG的本质是可伸缩的,我尝试过摆弄SVG的属性,但问题仍然存在。我应该怎么做才能保留这个SVG <?xml version="1.0" encoding="utf-8"?> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/x

我有一个纸飞机的SVG,我想把它放在一个圆里面。 但是,当我执行以下操作时,SVG的边缘会被裁剪。SVG的本质是可伸缩的,我尝试过摆弄SVG的属性,但问题仍然存在。我应该怎么做才能保留这个SVG

<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 18.7 14.3" style="enable-background:new 0 0 18.7 14.3;" xml:space="preserve">
<style type="text/css">
    .st0{fill:#000;}
</style>
<path class="st0" d="M18.7,0L0.3,4.1l3,3.6L0,9.4l0.5,4.9l5.6-4.1l2.3,1.5L18.7,0z M1.3,4.4L16,1.2L3.8,7.4L1.3,4.4z M10.3,4.7
    l-9.3,5.5l-0.2,1.7L0.6,9.7L10.3,4.7z M1.2,13.2l0.4-2.7l2.6-1.6l1.5,1L1.2,13.2z M4.7,8.6l12-7.1l-8.3,9.5L4.7,8.6z"/>
</svg>

要演示@exaneta的原始建议,我无法想象它会对网格系统产生任何影响,请运行下面的代码片段。如果这不是你想要实现的,我将删除这个答案

。选择{
背景色:#E0D6AF;
边界半径:50%;
高度:200px;
宽度:200px;
利润率:10px自动;
转变:转变0.2s;
变换:比例(1);
z指数:10;
显示器:flex;
证明内容:中心;
对齐项目:居中;
}
.choice>img#纸张{
宽度:60%;
}


之所以发生这种情况,是因为您用边框半径切掉了svg的角。我会将图像放入带有填充的div
.choice
。此外,svg不是正方形。看一看
viewBox=“0 0 18.7 14.3”
这样做会让我的网格系统变得一团糟:/在这种情况下,你应该分享你的“网格系统”来获得一些个性化建议。我感觉到一些消极的攻击性,不过没关系——马上就来!你的HTML呢?你能添加你的HTML吗。