作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我要填写 <div>
使用颜色并向边框添加阴影,但我的代码正在执行此操作。我实际上需要它,如图所示。
<svg height="125" width="1349">
<path d="M -35 100 s 35 50 75 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="none" />
<path d="M 40 100 s 75 -125 150 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="rgb(255, 195, 56)" />
<path d="M 190 100 s 35 50 75 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="none" />
<path d="M 265 100 s 75 -125 150 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="rgb(255, 195, 56)" />
<path d="M 415 100 s 35 50 75 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="none" />
<path d="M 490 100 s 75 -125 150 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="rgb(255, 195, 56)" />
<path d="M 640 100 s 35 50 75 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="none" />
<path d="M 715 100 s 75 -125 150 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="rgb(255, 195, 56)" />
<path d="M 865 100 s 35 50 75 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="none" />
<path d="M 940 100 s 75 -125 150 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="rgb(255, 195, 56)" />
<path d="M 1090 100 s 35 50 75 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="none" />
<path d="M 1165 100 s 75 -125 150 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="rgb(255, 195, 56)" />
<path d="M 1315 100 s 35 50 75 0" stroke="rgb(255, 195, 56)" stroke-width="5" fill="none" />
Sorry, your browser does not support inline SVG.
</svg>
最佳答案
对于这样的形状,您可以使用 svg pattern并填充一个矩形宽度的图案,如下例所示:
html,body{margin:0;padding:0;}
div{
background: url('http://i.imgur.com/qi5FGET.jpg');
background-size:cover;
overflow:hidden;
}
svg{display:block;}
<div>
<h1>title</h1>
<p>whatever content<br/>with several lines</p>
<svg viewbox="0 0 60 10">
<pattern x="-7.5" id="waves" patternUnits="userSpaceOnUse" width="10" height="10">
<path d="M0 10 V5 Q2.5 2.5 5 5 T10 5 V10" fill="#FFC338" />
</pattern>
<rect x="0" y="0" width="60" height="10" fill="url(#waves)"/>
</svg>
</div>
关于html - 用波浪边框 SVG 路径填充一个 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37301702/
我目前正在开发一个具有模块化设计的网站,其中包含文本模块、图像模块、2 列模块......用户可以根据需要添加/删除/重新排序它们。 每个模块都有一个波浪形/flex 的边框: 有没有可能用css做这
我正在尝试在网站上创建波浪效果 like this其中有一个主色波(深紫色),然后是沿边缘的浅色波。我已尝试使用 CSS position 和 top 定位多个路径,但无法使它们工作。 这是我的基本波
如何在透明图像背景上构建波浪? 布局图像: 我需要白色顶部背景中的波浪。 最佳答案 我稍微改进了 akshay 的回答版本。这包括两个单独的选项。 选项 1 如果不需要保留宽高比,则曲线将随宽度变化。
我是一名优秀的程序员,十分优秀!