html - 部分顶部和底部的波浪背景
问题描述
我有一个常见问题解答部分,我希望顶部部分具有顶部波浪背景,底部部分也具有波浪背景
这是我到目前为止所拥有的
HTML
<section id="faq">
<div id="details">
</div>
</section>
css
#faq{
background-image: url("wave-top.svg")
background-repeat: no-repeat, repeat;
background-color: blue;
}
这是我的两张背景图片
底波
我需要做什么才能得到我想要的?
解决方案
使用多个背景并调整background-size
/ background-position
:
.box {
padding:11% 0; /* The padding is the area for the shapes, adjust it based on the ratio of the shape*/
height:100px; /* to illustrate the space for the content */
background:
url(https://i.stack.imgur.com/mG3Vb.png) top /100% auto,
url(https://i.stack.imgur.com/JSEyE.png) bottom/100% auto,
linear-gradient(#387dff,#387dff) content-box; /* Color between the shapes only on the content and not the padding*/
background-repeat:no-repeat;
}
<div class="box">
</div>
推荐阅读
- python - 如何使用 Beautiful Soup 从某个 url 下的所有子 url 获取信息?
- java - 如何将 log4j.properties 文件转换为 log4j2.xml 或 log4j2.properties 文件
- amp-html - 如何获取使用 AMP 分页的数据
- javascript - 在第 7 个子实时数据库“转换”为 json 数组之后
- python - train.py 文件中没有名为“tensorflow.contrib”的模块
- python - Python - 通过 Google Sheet API 创建和发布 Google Sheet 到网站
- vue.js - Nativescript-Vue:加载 Vuex 时出现“tns 预览”错误?
- mysql - MySQL 在一个非常简单的查询上非常慢
- r - 如何将曲线拟合到R中的数据
- python - 如何从 pyhton 中的 __init__ 方法传递值,因为它不返回任何值