<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>让ie6也支持max-width,和max-height实现图片等比例缩放</title>
<style> *{ margin:0; padding:0;}
ul{ list-style:none;}
img{ border:0;}
.box{ width:450px; height:auto; margin:100px; padding:10px;}
.box li{ float:left; width:100px; height:100px; padding:1px; margin:5px; border:1px solid #ccc; text-align:center;}
.box li img{ max-width:100px; max-height:100px;_width: expression(this.width > 100 && this.width > this.height ? 100 :true);
_height: expression(this.height > 100 ? 100 : true);}
</style>
</head> <body>
<div class="box">
<ul>
<li><a href="#"><img src="img/01.jpg" width="50" height="50" /></a></li>
<li><a href="#"><img src="img/Windows Logo.jpg" /></a></li>
<li><a href="#"><img src="img/04.jpg" /></a></li>
<li><a href="#"><img src="img/06.jpg" /></a></li>
<li><a href="#"><img src="img/09.jpg" /></a></li>
</ul>
</div>
</body>
</html>

(转载)让ie6也支持max-width,和max-height实现图片等比例缩放的更多相关文章

  1. 让ie6也支持max-width,和max-height实现图片等比例缩放

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. 【转载】如何让图片按比例响应式缩放、并自动裁剪的css技巧

    原文: http://blog.csdn.net/oulihong123/article/details/54601030 响应式网站.移动端页面在DIV CSS布局中对于图片列表或图片排版时, 如果 ...

  3. 转载:牛魔王的世界观 »谈谈ie6不支持min-height与max-height的解决方法

    转载网址:http://www.niumowang.org/html-css/ie6-min-height/ 手里的项目还在继续,今天正好遇到了min-height的问题,干脆在这里记录下来.我是喜欢 ...

  4. 解决IE6不支持position:fixed;的问题

    在网页设计中,时常要用到把某个元素始终定位在屏幕上,即使滚动浏览器窗口也不会发生变化. 一般我们会使用position:fixed来进行绝对固定,但IE6并不支持position:fixed属性,所以 ...

  5. [css选择器]总结:IE6不支持的CSS选择符

    转载地址:https://www.wenjiwu.com/doc/zvsbii.html.此文最后也给出了原文地址,但是我点击过去发现是什么赌博彩票的地址,360也弹出小心的提示,所以这里只给出了我转 ...

  6. 解决ie6不支持position: fixed;导致无法滚动的办法

    <div id="im" style="top: 100px; position: fixed; left: 5px; border: 3px solid #006 ...

  7. 修正IE6不支持position:fixed的bug(转)

    众所周知IE6不支持position:fixed,这个bug与IE6的双倍margin和不支持PNG透明等bug一样臭名昭著.前些天我做自己的博客模板的时候,遇到了这个问题.当时就简单的无视了IE6— ...

  8. IE6不支持min-heightt和min-width的解决办法

    IE6不支持min-height的解决办法 最小高度min-height是很有用的,但IE6却不支持.真烦人.有没有办法呢? 我们可以利用IE6不识别!important来实现: height:aut ...

  9. IE6不支持min-height或max-width等完美解决方法

    又是IE6!!!坑人的IE6,不支持min-height,但是实际操作中,这个属性是非常需要的.那IE6下面怎么实现呢?请看geniusalien提供的完美解决方案:(geniusalien温馨提示: ...

随机推荐

  1. LNMP一键安装脚本

    #!/bin/bash #LNMP(Fastcgi) #CentOS + MySQL 5.5 #-- iptables -F iptables -X iptables -Z iptables -A I ...

  2. (转载)PHP 动态生成表格

    (转载)http://hi.baidu.com/shawns/item/c7d51f351c6a0482b711dba6 提要:PHP能够高效地生成HTML代码,其中,动态生成表格是实际应用中经常碰到 ...

  3. HDOJ(HDU) 2153 仙人球的残影(谜一样的题、、、)

    Problem Description 在美丽的HDU,有一名大三的同学,他的速度是众所周知的,跑100米仅仅用了2秒47,在他跑步过程中会留下残影的哎,大家很想知道他是谁了吧,他叫仙人球,既然名字这 ...

  4. 高效算法——M 扫描法

    In an open credit system, the students can choose any course they like, but there is a problem. Some ...

  5. Android公共库——图片缓存 网络缓存 下拉及底部更多ListView 公共类

    Android公共库——图片缓存 网络缓存 下拉及底部更多ListView 公共类 转载自http://www.trinea.cn/android/android-common-lib/ 介绍总结的一 ...

  6. Android从网络下载文件

    1.主Activity public class MainActivity extends Activity { private Button download=null; private EditT ...

  7. C++程序原码

    直接插入排序基本算法 #include<iostream.h> #include<stdlib.h> #include<time.h> const int n=10 ...

  8. Apache multiple domains setup

    Running several name-based web sites on a single IP address. Your server has a single IP address, an ...

  9. easyUI属性总结

    1.div easyui-window        生成一个window窗口样式.      属性如下:                   1)modal:是否生成模态窗口.true[是] fal ...

  10. 分享一个linux和linux的文件传输【scp无密码传输】

    很多时候,本地测试服务器想把文件传到线上服务器的时候,很多人都是通过登陆线上服务器ssh 传输,这样挺危险的,很多弊端....所以我找了下方法,发现scp挺好用的! 模拟环境: 192.168.147 ...