使用css样式实现动态图片裁剪示例
2016-06-23来源:

使用样式实现动态图片裁剪

代码如下:

<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en

<a href=http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd>http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd</a>></p> <p><html xmlns=<a href=http://www.w3.org/1999/xhtml>http://www.w3.org/1999/xhtml</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 class=crop>

<img src=paper-sculpture-large.jpg class=crop alt=paper sculpture large>

</div></p> <p></body>

</html>

推荐信息
Baidu
map