[英]How do I prevent the image in the background from zooming in modal mode?
I have 4 pictures and a background image and I wrote a modal for each of them.我有 4 张图片和一张背景图片,我为每张图片都写了一个模态。 When I click on the image and it opens in modal mode, the background image also zooms in a bit.
当我单击图像并以模态模式打开时,背景图像也会放大一点。 In chrome dev tools, I see that a new class is added to body called .modal-open and properties and values are added in the css.
在 chrome 开发工具中,我看到一个名为 .modal-open 的新类被添加到主体中,并且属性和值被添加到 css 中。
body.modal-open {
padding-right: 16px;
display: block; }
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto; }
How do I prevent the image in the background of the body element from zooming in?如何防止主体元素背景中的图像放大?
CSS CSS
.bg-image {
background-image: url("Pictures/English-lang-background.jpg");
background-size: cover;
overflow: auto;
}
HTML HTML
<body>
<div class="bg-image">
</div>
</body>
Correct, @iamwhitebox.正确,@iamwhitebox。 It solves the problem.
它解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.