CSS 位置 clip 属性
描述
clip属性定义了绝对定位元素内容不可见的区域之外的区域。
可能的取值
- auto − 裁剪区域与定位元素的内容区域相等。
 - 
shape − 形状描述符。截至CSS2,只有一个有效的形状:rect(top right bottom left)。
 
适用对象
块级元素和替换元素。
DOM语法
object.style.clip = rect(top right bottom left);
示例
以下是显示此属性效果的示例-
<html>
   <head>
      <style type = "text/css">
         div {
            background: url(/images/css.gif);
            clip:rect(10px, 155px, 145px, 10px);
            border:2px solid black;
            height:100px;
            width:150px;
            position:absolute;
            top:inherit;
            left:0px;
         }
      </style>
   </head>
   <body>
      <div>Example of clipping one image using css clip property</div>
   </body>
</html>
它将产生以下结果−

极客教程