在线文档教程
CSS
逻辑属性 | Logical Properties

余量 - 嵌段 - 端 | margin-block-end

margin-block-end

这是一种实验技术

由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。还要注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。

margin-block-end 映射到取决于元件的写入模式,方向性,和文本方向的物理余量的逻辑块端部边缘。

/* <length> values */ margin-block-end: 10px; /* An absolute length */ margin-block-end: 1em; /* relative to the text size */ margin-block-end: 5%; /* relative to the nearest block container's width */ /* Keyword values */ margin-block-end: auto; /* Global values */ margin-block-end: inherit; margin-block-end: initial; margin-block-end: unset;

它对应于margin-topmargin-rightmargin-bottom,或margin-left属性根据为定义的值writing-modedirectiontext-orientation

它涉及到margin-block-startmargin-inline-start以及margin-inline-end,它定义了元件的另一边缘。

初始值0
应用于same as margin
是否继承no
百分比depends on layout model
适用媒体visual
计算值if specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto
Animation typediscrete
规范顺序the unique non-ambiguous order defined by the formal grammar

句法

价值

margin-block-end属性采用与margin-left属性相同的值。

形式语法

<'margin-left'>

HTML内容

<div> <p class="exampleText">Example text</p> </div>

CSS内容

div { background-color: yellow; width: 120px; height: 120px; } .exampleText { writing-mode: vertical-rl; margin-block-end: 20px; background-color: #c8c800; }

规格

SpecificationStatusComment
CSS Logical Properties Level 1The definition of 'margin-block-end' in that specification.Editor's DraftInitial definition

浏览器兼容性

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic supportNo support41.0 (41.0)1No supportNo supportNo support

FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic supportNo support41.0 (41.0)1No supportNo supportNo support