相关疑难解决方法(0)

SVG背景重复之间的空白

我似乎无法摆脱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)

html css svg

15
推荐指数
2
解决办法
5669
查看次数

如何创建波浪形CSS?

请查看下面的图片,了解我要创建的内容:

在此处输入图片说明

到目前为止,我有以下内容,但它需要更加“频繁”,例如增加正弦或余弦波的频率。

#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)

html css css-shapes

3
推荐指数
1
解决办法
684
查看次数

标签 统计

css ×2

html ×2

css-shapes ×1

svg ×1