Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.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/css将图像缩放到手机_Html_Css_Mobile - Fatal编程技术网

html/css将图像缩放到手机

html/css将图像缩放到手机,html,css,mobile,Html,Css,Mobile,好的,我正在尝试将我的背景图像从桌面正确缩放到手机。我使用的代码是: CSS 使用该代码,手机上显示的图像大小约为35x65px(图像“bg mobile”为337宽X 667高,因为我发现css代码应该可以工作,但没有人能帮助我(对不起,我不知道我能说得有多具体)也许最好将图像的分辨率与自身成比例缩放 HTML: <div class="img_resz"> <img src="img.jpg"> </div> 变化没有影响:(,谢谢你的快速响应。

好的,我正在尝试将我的背景图像从桌面正确缩放到手机。我使用的代码是:

CSS


使用该代码,手机上显示的图像大小约为35x65px(图像“bg mobile”为337宽X 667高,因为我发现css代码应该可以工作,但没有人能帮助我(对不起,我不知道我能说得有多具体)

也许最好将图像的分辨率与自身成比例缩放

HTML

<div class="img_resz">
    <img src="img.jpg">
</div>

变化没有影响:(,谢谢你的快速响应。你可以修改一下html和css。我想我可以帮你。也许还有另一个css规则正在改变背景图像的行为。正如Brain已经说过的,请提供一个JS fiddle或类似的东西来获取更多上下文JS fiddler无法加载到我的电脑上,我上传了将站点rar文件保存到谷歌硬盘,并可以下载(我希望没问题)
background-position: center center;
<div class="img_resz">
    <img src="img.jpg">
</div>
.img_resz img 
{
    width: 50%;
}