根据浏览器大小自动调整分辨率的全尺寸图像
P粉302160436
P粉302160436 2023-08-16 11:40:39
0
1
307
<p>我有一个货运网站。</p> <p>如何使我的悬停图片填满整个屏幕,并且不受计算机屏幕分辨率的影响。当我缩小浏览器窗口时,它们还应该进行裁剪和缩小。谢谢。</p> <pre class="brush:php;toolbar:false;">.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; }</pre> Image Hover One {image 1} Image Hover Two {image 2} <p>我尝试过使用像素,但那是特定于分辨率的。</p>
P粉302160436
P粉302160436

热门教程
더>
最新下载
더>
网站特效
网站源码
网站素材
프론트엔드 템플릿
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!