html - 如何将“背景图片放在另一个 div”上?
问题描述
这个问题可能并不酷,但想知道解决此任务的正确方法。当然使用 HTML、CSS、Bootstrap。 像这样的东西:
解决方案
快速示例,使用负边距顶部将部分放在其他部分上,如果您愿意,可以用背景图像替换样式。
<section style="background:red;width:100%;height:300px">
</section>
<section style="width:100%;margin-top:-150px">
<div class="container">
<div style="width:100%;height:300px; background: white;"></div>
</div>
</section>
推荐阅读
- timer - 在 STM32 中使用定时器实现延迟
- sql - 算术异常数字溢出或字符串截断字符串右截断火鸟,插入表时
- php - 如何将示例数据的输出更改为 2 列而不是 1 列
- c - 从管道中读取字符串不一致
- docker - 如何将 MySQL 数据库和 PHP/JS 应用程序转换成可以部署在 Kubernetes 集群中的镜像?
- python - 在训练期间更改 Keras LSTM 状态
- c - 此处带有括号平衡的语义错误
- c# - 为什么我的代码没有意识到有一个 } 来关闭构造函数
- javascript - Firebase,如何对日期范围内的键进行排序
- image - 从 URL 下载图像时无法打开