html - 你如何制作一个覆盖整个屏幕顶部的 div?以及如何插入将填充整个 div 的图像?
问题描述
我目前正在练习,但我似乎无法让它发挥作用。
我会给出一些代码,但不知道如何缩进代码,所以为此使用这个 jpg。
https://roco.studio/wp-content/uploads/2014/12/img_banner-thin_mountains.jpg
解决方案
.img-wrapper{
width:100%;}
.img-wrapper img{
width:100%;
}
<div class="img-wrapper">
<img src="https://roco.studio/wp-content/uploads/2014/12/img_banner-thin_mountains.jpg" />
</div>
推荐阅读
- sbt - 获取系统属性在调试日志级别无法正常工作
- memory-leaks - RxJS:在 takeUntil 之后使用重复创建订阅泄漏
- angular - 如何使用 karma jasmine 对依赖于另一个函数的函数进行单元测试
- php - Cookie 不会设置,没有结果
- python - 在 python 中读取德语 csv 文件的问题
- opencv - 来自应用程序的 OpenCv + Gstreamer,初始延迟 30 秒
- amazon-web-services - 确保在 AWS S3 同步期间数据不会丢失
- php - 如何通过 agi php 写入文件?
- php - 明智地显示或隐藏内容用户角色
- python - 获取数组中最大元素的数组索引号的最佳方法