我有一个货运网站。
如何使我的悬停图片填满整个屏幕,并且不受计算机屏幕分辨率的影响。当我缩小浏览器窗口时,它们还应该进行裁剪和缩小。谢谢。
.hover-image {
display: flex;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: -1;
pointer-events: none;
flex-direction: column;
align-items: center;
justify-content: center;
/* 将宽度和高度更改为缩放图像 */
width: 100vw;
height: auto;
}
.hover-image img {
max-width: 100% !important;
max-height: 100% !important;
width: auto !important;
height: auto !important;
margin-bottom: 0;
}
Image Hover One
{image 1}
Image Hover Two
{image 2}
我尝试过使用像素,但那是特定于分辨率的。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号