格式以下: css
div { position: absolute; clip: rect(0, 50px, auto, 0); }这里是详解:
http://tympanus.net/codrops/2013/01/16/understanding-the-css-clip-property/ html
注意点:
1. 奇皅的rect参数,注意它的right和bottom定义有点反人类。
2. 必须给元素设置position为absolute和fixed.
3. rect参数只接受数值,不接受百分比(反响应式设计),可是接受一个特别的叫auto的参数,表示100% ui
Now, let’s finally dig into the rect() syntax. It requires four length values, separated by commas: top, right, bottom and left. As for padding or margin shorthands, it’s clockwise. spa
clip: rect(<top>, <right>, <bottom>, <left>);
Now pay attention because it can be tricky. Both the top and the bottom values define the offset from the top border and the left and right values define the offset from the left border. .net
最后 。。MD,,要求position必须是absolute, 而设置成absolute之后,该元素就从正常的文档流中拿走了。。切记。 设计