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

建站知识 2021-07-03 08:15www.168986.cn长沙网站建设

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


复制代码
代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"<a href="http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"></p> <p><html xmlns="<a href="http://.w3./1999/xhtml">http://.w3./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>

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by