Html iPhone图像赢得';t中心
尝试将iPhone版本的照片合并到我的网站,但只有当iPhone水平时,照片才会居中。垂直时,图像“zoe iphone.png”会在屏幕右侧流血。有没有办法调整这个代码使图像居中?在桌面上看起来不错Html iPhone图像赢得';t中心,html,css,iphone,image,Html,Css,Iphone,Image,尝试将iPhone版本的照片合并到我的网站,但只有当iPhone水平时,照片才会居中。垂直时,图像“zoe iphone.png”会在屏幕右侧流血。有没有办法调整这个代码使图像居中?在桌面上看起来不错 <html> <div class="w3-container w3-center"> <p> <picture> <div class = "center&quo
<html>
<div class="w3-container w3-center">
<p>
<picture>
<div class = "center">
<source media="(max-width: 790px)"
srcset="zoe-iphone.png">
</div>
<source media="(min-width: 791px)"
srcset="zoe2.jpg">
<img src="zoe2.jpg" max-width="80%" height="400">
</picture>
</p>
</div>
</html>
我建议使用flexbox
中心{
弯曲方向:立柱;
证明内容:中心;
对齐项目:居中;
}
我两次都尝试了,但都没有成功:/maxwidth的设置方式可能是这样吗?因为它看起来很好,当手机水平时,你的iPhone分辨率是多少?