【发布时间】:2015-04-09 22:42:06
【问题描述】:
我似乎无法摆脱 Illustrator CS5 导出的 SVG 元素重复(作为 CSS 背景)之间的空白。
我使用的是简单的 CSS background-image 和 background-repeat: repeat-x,但每次重复之间总是有这个空白。我根本没有使用background-size。
这是我所看到的(在 Safari/Chrome 上测试):
如果我打开 SVG 以检查侧面是否有任何空白,则什么都没有(见右侧的窗口),它一直到窗口的一侧:
我尝试通过File -> Scripts -> SaveDocsAsSVG 和Save as.. -> SVG 将图像保存在Illustrator 中。
HTML
<body>
<div class="outer">
<div class="inner">
</div>
</div>
</body>
CSS
.outer {
background-color: #7fcefb;
height: 700px;
background-image: url('/wp-content/themes/grizzly/assets/img/trees.png');
background-position: center 95%;
background-repeat: repeat-x;
}
.inner {
background-image: url('/wp-content/themes/grizzly/assets/svg/treeshill.svg');
height: 700px;
background-position: center bottom;
background-repeat: repeat-x;
}
【问题讨论】:
-
您可以发布您的代码或链接吗?看起来某些东西可能有轻微的边距或填充。
-
你能把图片的链接贴出来吗?
-
添加了一些基本的 HTML 和 CSS 来显示设置。 SVG 下载 - s000.tinyupload.com/?file_id=02705325478483063668