0
点赞
收藏
分享

微信扫一扫

css inset属性

Mhhao 2023-01-23 阅读 94

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 CSS属性,它具有与简写边距相同的多值语法。虽然是CSS逻辑属性规范的一部分,但它定义物理偏移量,而不考虑元素的书写模式、方向和文本方向。属性值可以为长度,百分比,关键字(auto),全局的值(inherit; initial; revert; revert-layer; unset;)

注意:inset 属性只作用于定位元素。Internet Explorer 浏览器上不支持该属性。

箴言:因为这些东西是非常简单的。不要抱怨自己学不会,那是因为你没有足够用心。




举报

相关推荐

css属性①

CSS属性

css 属性

CSS(二)——CSS字体属性

CSS常用属性

css样式属性

0 条评论