简体   繁体   English

你如何制作一个覆盖整个屏幕顶部的div? 以及如何插入将填充整个 div 的图像?

[英]How do you make a div that covers the whole top part of the screen? and how do you insert an image that will fill in that entire div?

I'm currently doing a practice but I can't seem to get it to work.我目前正在练习,但我似乎无法让它发挥作用。

i'd give some code but idk how to indent the code so for this use this jpg.我会给出一些代码,但不知道如何缩进代码,因此为此使用此 jpg。

https://roco.studio/wp-content/uploads/2014/12/img_banner-thin_mountains.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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM