margin-inline-start

介绍

在阅读模式的开始方向设置与元件相关联的盒子模型的外边距。 该属性可以为负值。 在 LTR 模式下,margin-inline-start 等价于 margin-left。 在 RTL 模式下,margin-inline-start 等价于 margin-right

使用示例

语法

/* <length> values */
margin-inline-start: 0.5em;
margin-inline-start: 0px;
margin-inline-start: 2rpx;

/* <percentage> value */
margin-inline-start: 10%;

取值

0px

默认值

<length>

<length> 定义了一个确定的宽度值。可以为负值。

<percentage>

相对于包含块的宽度,以百分比值为外边距。

auto

让布局流程自己选择一个合适的外边距。

INFO

目前支持在弹性布局网格布局线性布局的非 position: fixed/absolute/sticky 子元件中使用。

其中,对于线性布局,仅支持在交叉轴方向上使用 auto

形式定义

初始值0
适用元素所有元件
是否支持继承
是否支持动画
百分比refer to the width of the containing block

形式语法

margin-inline-start =
  <length-percentage>  |
  auto                 |

<length-percentage> =
  <length>      |
  <percentage>

与 Web 的区别

mdn: margin-inline-start

  1. 在 Lynx 下,margin 任何情况都不会重叠。
  2. 目前支持在弹性布局网格布局线性布局的非 position: fixed/absolute/sticky 子元件中使用 auto。其中,对于线性布局,仅支持在交叉轴方向上的外边距 auto 值。

兼容性

LCD tables only load in the browser

除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。