有没有办法防止缩放页面时调整背景图像的大小?
背景图像只是一个简单的图案,在 100% 的情况下看起来效果最好。 有没有办法防止在缩放页面时调整此类背景图像的大小?
The background-image is just a simple pattern that looks best at 100%.
Is there a way to prevent such a background-image from being resized when zooming the page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
缩放是浏览器功能,它只是放大您在浏览器中看到的所有内容,因此您无法保持图像大小固定
zoom is browser feature and it's just enlarge everything you see in your browser so there is nothing you can do to keep the size of the images fixed
您可能可以尝试将图像拉入 HTML 文档:
然后继续使用 CSS,您可以将以下样式应用于保存图像的 div:
上面的样式集将设置您的图像以很好地适应任何浏览器并防止背景图像的大小或扩大到大约 3 倍的缩放。请务必填写适当的最小宽度值,以便在调整浏览器大小时,图像将通过调整大小或裁剪来保持正确的比例。
you could probably try pulling in an image into your HTML document instead:
then going on to your CSS, you could apply the following style to that div holding the image:
the above style set will set your image to fit nicely into any browsers and prevent the background-image from resizing or expanding up to about 3 times of the zoom. be sure to fill in the appropriate value for the min-width so that in the event that the browser is resized, the image will maintain the correct proportion by resizing or cropping off.