css图片自动绽放大小,左右,上下居中

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>无标题页</title>
    <style type="text/css">
        .pic
        {
        	max-height:400px;
        	max-width:400px;
        	_width:expression("400px");
        	_height:expression((document.documentElement.clientHeight||document.body.clientHeight)>400?"400px":"");
            /*_width:expression((document.documentElement.clientWidth||document.body.clientWidth)>(document.documentElement.clientHeight||document.body.clientHeight)?"400px":"");*/
            /*_height:expression(document.documentElement.clientWidth>document.documentElement.clientHeight?(document.documentElement.clientHeight*(400*2-68)/document.documentElement.clientWidth+"px"):"400px");*/
            overflow:hidden;
            margin-left:-55px;
            margin-Right:-55px;
            padding:0px;
        }
        table
        {
        	width:400px;
        	height:400px;
        	border:0px;
        	border-collapse:collapse;
        	margin:0px;
        	padding:0px;
        }
        
        tr
        {
        	margin:0px;
        	padding:0px;
        	width:400px;
        	height:400px;
        }
        
        td
        {
        	text-align:center;
        	margin:0px;
        	padding:0px;
        	width:400px;
        	height:400px;
        }
        
    </style>
</head>
<body>
    <div style="border:solid 1px blue;width:400px;height:400px;margin:0px;background-color:Gray;">
        <table>
            <tr>
                <td>
                    <img class="pic" src="123.jpg" alt=""/>
                </td>
            </tr>
        </table>
    </div>
    <br />
    <br />
    <br />
    <br />
    <br />
    <div style="border:solid 1px blue;width:400px;height:400px;margin:px;background-color:Gray;">
        <table>
            <tr>
                <td>
                    <img class="pic" src="456.jpg" alt=""/>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>

 
 
 

  

转载于:https://my.oschina.net/bangle/blog/100600

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值