Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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 Chrome在css中重新调整图片大小。Ie没有。(idk关于ff)_Html_Css_Image_Internet Explorer_Resize - Fatal编程技术网

Html Chrome在css中重新调整图片大小。Ie没有。(idk关于ff)

Html Chrome在css中重新调整图片大小。Ie没有。(idk关于ff),html,css,image,internet-explorer,resize,Html,Css,Image,Internet Explorer,Resize,我的代码如下。超链接在那里,因此如果你点击图片,它会带你进入另一个页面,但该页面不属于我的问题。我想做的是使用css根据web浏览器的高度重新调整图像的大小。在谷歌chrome中,它可以工作,但在ie和idk中,它不能工作。如果有人能告诉我出了什么问题,并以一种能使我的代码适用于所有浏览器的方式重写我的代码,我将不胜感激 <!DOCTYPE html> <head> <style> .size{height:100%;} .test{width:auto;

我的代码如下。超链接在那里,因此如果你点击图片,它会带你进入另一个页面,但该页面不属于我的问题。我想做的是使用css根据web浏览器的高度重新调整图像的大小。在谷歌chrome中,它可以工作,但在ie和idk中,它不能工作。如果有人能告诉我出了什么问题,并以一种能使我的代码适用于所有浏览器的方式重写我的代码,我将不胜感激

<!DOCTYPE html>

<head>

<style>
.size{height:100%;}
.test{width:auto;height:100%;}
</style>


</head>

<body>

<div class="size">
<a href="test2.html"><img class="test" src="test.jpg" border="0"></a> 
</div>



</body>

.size{高度:100%;}
.test{宽度:自动;高度:100%;}

您可以将图像放入容器中,然后按如下方式设置css

<html>
<head>
 <style>
    a.container { 
      width:100%;
      height:100%;
      display:block;
    }
    a#image1 {
        background: url(YOURIMAGE.jpg) no-repeat center center fixed; 
      -webkit-background-size: cover;
      -moz-background-size: cover;
      -o-background-size: cover;
      background-size: cover;
    }

    </style>
</head>

<body>
    <a class="container" id="image1" href="#"></a>
</body>
</html>

a、 容器{
宽度:100%;
身高:100%;
显示:块;
}
a#图1{
背景:url(YOURIMAGE.jpg)无重复中心固定;
-webkit背景尺寸:封面;
-moz背景尺寸:封面;
-o-背景尺寸:封面;
背景尺寸:封面;
}
然后,您可以为每个标签标识一个链接,并在css中为其创建一个引用。这不会使整个图像填满页面,也不会成为链接