Skip to content

Instantly share code, notes, and snippets.

@marsz
Created March 24, 2011 06:51
Show Gist options
  • Save marsz/884674 to your computer and use it in GitHub Desktop.
Save marsz/884674 to your computer and use it in GitHub Desktop.
clip + css spreties
<html>
<head>
<style type="text/css">
div {
position:relative;
top:-100px;
}
img {
position: absolute;
clip:rect(100px 100px 200px 0px);
}
</style>
</head>
<body>
<p>clip 属性剪切了一幅图像:</p>
<div>
<a href="#"><img border="0" src="http://www.google.com.tw/logos/2011/houdini11-hp.jpg" width="120" height="151"></a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment