Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html iPhone图像赢得';t中心_Html_Css_Iphone_Image - Fatal编程技术网

Html iPhone图像赢得';t中心

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

尝试将iPhone版本的照片合并到我的网站,但只有当iPhone水平时,照片才会居中。垂直时,图像“zoe iphone.png”会在屏幕右侧流血。有没有办法调整这个代码使图像居中?在桌面上看起来不错

<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分辨率是多少?