格式如下:
div { position: absolute; clip: rect(0, 50px, auto, 0);}这里是详解:
注意点:
1. 奇皅的rect参数,注意它的right和bottom定义有点反人类。 2. 必须给元素设置position为absolute和fixed. 3. rect参数只接受数值,不接受百分比(反响应式设计),但是接受一个特别的叫auto的参数,表示100%The rect() function
Now, let’s finally dig into the rect() syntax. It requires four values, separated by commas: top, right, bottom and left. As for padding or margin shorthands, it’s clockwise.
clip: rect(, , , );
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.
最后 。。MD,,要求position必须是absolute, 而设置成absolute以后,该元素就从正常的文档流中拿走了。。切记。