【发布时间】:2022-01-18 01:46:39
【问题描述】:
我正在尝试在小型设备上制作覆盖整个屏幕(没有边距或填充)的图像。不幸的是,on this post 提出的技术对我不起作用。
这是我目前拥有的代码。 (在https://jsfiddle.net/ 上测试)。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid bg-primary">
<div class="row">
<div class="col-md-9">
<div class="image-wraper">
<figure class="figure">
<img
src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/8-col/img%20(73).jpg"
class="figure-img img-fluid rounded shadow-3 mb-1"
alt="Taking up Water with a Spoon"
style="height: 100%; width: 100%; object-fit: cover;"
/>
<figcaption class=" figure-caption">A caption for the above image.</figcaption>
</figure>
</div>
</div>
<div class="col-md-3">
...
</div>
</div>
</div>
</body>
</html>
左右还有边距。如何在小于或等于sm的屏幕上删除它?
【问题讨论】:
标签: html css bootstrap-4