我似乎无法摆脱Illustrator CS5导出的SVG元素重复(作为CSS背景)之间的这个空白区域.
我使用的是一个简单的CSS background-image,background-repeat: repeat-x但每次重复之间总会有这个空格.我根本就没用background-size.
这是我所看到的(在Safari/Chrome上测试):

如果我打开SVG检查侧面是否有空格,那么没有任何东西(见右边的窗口),它一直到窗口的一侧:

我尝试用File -> Scripts -> SaveDocsAsSVG和保存在Illustrator中的图像Save as.. -> SVG.
HTML
<body>
<div class="outer">
<div class="inner">
</div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
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;
}
Run Code Online (Sandbox Code Playgroud) 请查看下面的图片,了解我要创建的内容:
到目前为止,我有以下内容,但它需要更加“频繁”,例如增加正弦或余弦波的频率。
#wave {
position: relative;
height: 70px;
width: 600px;
background: #e0efe3;
}
#wave:before {
content: "";
display: block;
position: absolute;
border-radius: 100% 50%;
width: 340px;
height: 80px;
background-color: white;
right: -5px;
top: 40px;
}
#wave:after {
content: "";
display: block;
position: absolute;
border-radius: 100% 50%;
width: 300px;
height: 70px;
background-color: #e0efe3;
left: 0;
top: 27px;
}Run Code Online (Sandbox Code Playgroud)
<div id="wave"></div>Run Code Online (Sandbox Code Playgroud)