top

介绍

top属性定义了定位元素的上外边距边界与其包含块上边界之间的偏移,非定位元素设置此属性无效。定位元素参考position 属性

取值

样例:

/* <length> */
top: 3px;
top: 2rpx;
top: 2.4em;
top: 3rem;

top: 10%;
/* Keyword value */
top: auto;

top: calc(1px + 1px);
1
2
3
4
5
6
7
8
9
10
11

标准化语法

auto | <length> | <percentage>
1

与 Web 的区别

暂时不支持 inherit、initial、revert、unset 等取值。

Last Updated: 2022/7/15 下午7:22:06