使用樣式實現動態圖片裁剪
復制代碼代碼如下:
<!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>