简体   繁体   中英

How to resize a image that is displaying as stretched only on mobile phones?

I'm building a site for a friend and I'm having trouble understanding why the client image is stretched the entire vh if I select a client image on a mobile device. When I test the site on a desktop it shows as I would like, however, I'm not sure where the issue is stemming from. Instead of posting my entire code, I have provided the link to my repository and website. The live site can be found https://savetheyardllc.netlify.app/ , and my repo for the code is here https://github.com/ddelimond/Johnson-Landscaping , I would really appreciate the help. Sorry for any mistakes in formatting my question or any lack of information, Im new to stack.

手机问题图片 桌面视图

use object-fit: cover or object-fit: contain

read the guide here https://www.w3schools.com/css/css3_object-fit.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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