Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.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
Internet explorer Internet Explorer中的最大宽度和最大高度解决方案_Internet Explorer_Image_Css - Fatal编程技术网

Internet explorer Internet Explorer中的最大宽度和最大高度解决方案

Internet explorer Internet Explorer中的最大宽度和最大高度解决方案,internet-explorer,image,css,Internet Explorer,Image,Css,在本页中: 我使用的是最大宽度和最大高度 适用于Firefox、Chrome、Opera、Epiphany等浏览器,但不适用于Internet Explorer 在这种情况下,您推荐什么解决方案 我必须将最大宽度限制为180px,最大高度限制为180px。看看这项技术-我认为IE不支持最大宽度 检查此资源:。 请注意,它不适用于禁用Javascript的用户。尝试为IE max width添加以下内容: .maxwidth { zoom:1; maxwidth:express

在本页中:

我使用的是最大宽度和最大高度

适用于Firefox、Chrome、Opera、Epiphany等浏览器,但不适用于Internet Explorer

在这种情况下,您推荐什么解决方案


我必须将最大宽度限制为180px,最大高度限制为180px。

看看这项技术-我认为IE不支持最大宽度

检查此资源:。
请注意,它不适用于禁用Javascript的用户。

尝试为IE max width添加以下内容:

.maxwidth {
    zoom:1;
    maxwidth:expression(
        function(t){
            var w = t.parentNode.scrollWidth;
            if (w != t.w) {
                t.w = w;
                var max = parseInt(t.currentStyle['max-width'], 10);
                t.style.width = 'auto';
                if (t.scrollWidth > max) {
                    t.style.width = max;
                }
            }
        }(this)
    );
}

前面提到的解决方案可以在IE中实现最大宽度/高度,但只想指出,如果性能是一个问题,您可能需要考虑生成实际的缩略图图像,而不是依赖HTML/CSS大小

缩略图将导致更小的文件大小,您可能会裁剪它们以改善视觉方向。它还可以绕过对JavaScript的需求和/或CSS表达式的负面性能影响


从维护的角度来看可能不可行,但我想我应该提一下…

IE7支持最大高度/宽度。使用一个触发标准模式的DOCTYPE,它就会工作。