使用css樣式實現(xiàn)動態(tài)圖片裁剪示例

字號:


    使用樣式實現(xiàn)動態(tài)圖片裁剪
    代碼如下:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "<a ></p> <p><html xmlns="<a xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></p> <p> <title>untitled</title></p> <p> <style type="text/css" media="screen">
    div.crop {
    height: 300px;
    width: 350px;
    overflow: hidden;
    }
    div.crop img {
    margin: -300px -200px 0 0;
    }
    </style></p> <p></head></p> <p><body></p> <p><div>
    <img src="paper-sculpture-large.jpg">
    </div></p> <p></body>
    </html>