关于css:css-inset属性妙用

inset 属性用作定位元素的 top、right、bottom、left 这些属性的简写。相似于 margin 和 padding 属性,按照“上右下左”的程序。举个例子:

inset: 0; 
/* 等同于 `top: 0; right: 0; bottom: 0; left: 0;` */

inset: 1px 2px; 
/* 等同于 `top: 1px; right: 2px; bottom: 1px; left: 2px;` */

inset: 1px 2px 3px; 
/* 等同于 `top: 1px; right: 2px; bottom: 3px; left: 2px;` */

inset: 1px 2px 3px 4px; 
/* 等同于 `top: 1px; right: 2px; bottom: 3px; left: 4px;` */

留神:inset 属性只作用于定位元素。Internet Explorer 浏览器上不反对该属性!!!

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理