赞
踩
这个属性用于定义一个剪裁矩形。对于一个绝对定义元素,在这个矩形内的内容才可见。出了这个剪裁区域的内容会根据 overflow 的值来处理。剪裁区域可能比元素的内容区大,也可能比内容区小。
- JavaScript 语法:
- object.style.clip="rect(0px,50px,50px,0px)"
- shape 设置元素的形状。唯一合法的形状值是:rect (top, right, bottom, left)
- <html>
- <head>
- <style type="text/css">
- img
- {
- position:absolute;
- clip:rect(0px 50px 100px 0px)
- }
- </style>
- </head>
-
- <body>
- <p>clip 属性剪切了一幅图像:</p>
- <p><img border="0" src="/i/eg_bookasp.gif" width="120" height="151"></p>
- </body>
-
- </html>

值 | 描述 |
---|---|
absolute | 生成绝对定位的元素,相对于 static 定位以外的第一个父元素进行定位。 元素的位置通过 "left", "top", "right" 以及 "bottom" 属性进行规定。 |
fixed | 生成绝对定位的元素,相对于浏览器窗口进行定位。 元素的位置通过 "left", "top", "right" 以及 "bottom" 属性进行规定。 |
relative | 生成相对定位的元素,相对于其正常位置进行定位。 因此,"left:20" 会向元素的 LEFT 位置添加 20 像素。 |
static
| 默认值。没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。 |
inherit
| 规定应该从父元素继承 position 属性的值。 |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。