博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
理解css中的clip属性
阅读量:6689 次
发布时间:2019-06-25

本文共 793 字,大约阅读时间需要 2 分钟。

hot3.png

格式如下:

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.

schema-clip

最后 。。MD,,要求position必须是absolute, 而设置成absolute以后,该元素就从正常的文档流中拿走了。。切记。

转载于:https://my.oschina.net/uniquejava/blog/501897

你可能感兴趣的文章
[转]UML类图、关系及其JAVA代码
查看>>
PhotoShop算法原理解析系列 - 像素化---》碎片。
查看>>
设计模式之责任链模式
查看>>
在 Windows 下安装 Oracle 11g XE (Express Edition)
查看>>
php多态设计
查看>>
oracel SQL多表查询优化
查看>>
Spring-Context的注解实现依赖注入功能
查看>>
CSS格式化 CSS代码压缩工具
查看>>
Android的TextView使用Html来处理图片显示、字体样式、超链接等
查看>>
mvc伪静态<三> IIS配置
查看>>
.NET设计模式(12):外观模式(Façade Pattern)(转)
查看>>
【leetcode】Maximum Gap(hard)★
查看>>
Visual Studio中的lib的链接顺序
查看>>
Cacti安装详细步骤
查看>>
android自定义radiobutton样式文字颜色随选中状态而改变
查看>>
【CodeForces 604B】F - 一般水的题1-More Cowbe
查看>>
用JS获取地址栏参数的方法
查看>>
javascript中实现sleep函数
查看>>
ionic 001
查看>>
@params、@PathVariabl和@RequestParam用法与区别
查看>>