简体   繁体   English

在iPhone人像视图中图像无法缩放

[英]image won't scale in iPhone portrait view

I'm working on a project where I have two images, one scrolling underneath the other. 我正在一个项目中,我有两张图像,一个在另一个下方滚动。 The top image ("glasses") has fixed positioning and z-index=1. 顶部图像(“眼镜”)具有固定的位置,并且z-index = 1。 The other image ("quote") is left as is and is underneath the first. 另一个图像(“ quote”)保留不变,位于第一个图像的下方。 When I viewed the website in portrait mode on my iPhone, the fixed glasses image gets cut off, while the quote image scales down and fits within the screen dimensions. 当我在iPhone上以纵向模式查看网站时,固定眼镜图像会被剪切掉,而报价图像会缩小并适合屏幕尺寸。 It works fine on desktop and in landscape orientation. 它在桌面和横向都可以正常工作。 I've tried setting the width of the glasses image to 100% and using media queries to target the phone width, but I havent had much success. 我尝试将眼镜图像的宽度设置为100%,并使用媒体查询来定位手机宽度,但是我没有取得太大的成功。 The glasses just get squeezed and lose their normal shape. 眼镜只会被挤压而失去其正常形状。 I'd really appreciate any answers or suggestions. 我真的很感谢任何答案或建议。

Link to live project 链接到实时项目

the problem is in mobile/tablet views in general, not just iOS. 问题出在手机/平板电脑视图中,而不仅仅是iOS。

Remove min width and height from image and add 从图像中删除最小宽度和高度并添加

.quote,
.glasses {
  width: 100%;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM