CSS参考手册
逻辑属性 | Logical Properties
余量 - 嵌段 - 开始 | margin-block-start
这是一种实验技术
由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。还要注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。
margin-block-start
映射到取决于元件的写入模式,方向性,和文本方向的物理余量的逻辑块开始的余量。
/* <length> values */
margin-block-start: 10px; /* An absolute length */
margin-block-start: 1em; /* relative to the text size */
margin-block-start: 5%; /* relative to the nearest block container's width */
/* Keyword values */
margin-block-start: auto;
/* Global values */
margin-block-start: inherit;
margin-block-start: initial;
margin-block-start: unset;
它对应于margin-top
,margin-right
,margin-bottom
,或margin-left
属性根据为定义的值writing-mode
,direction
和text-orientation
。
它涉及到margin-block-end
,margin-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 type |
discrete |
规范顺序 |
the unique non-ambiguous order defined by the formal grammar |
句法
价值
margin-block-start
属性采用与该属性相同的值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-lr;
margin-block-start: 20px;
background-color: #c8c800;
}
规格
Specification |
Status |
Comment |
---|---|---|
CSS Logical Properties Level 1The definition of 'margin-block-start' in that specification. |
Editor's Draft |
Initial definition |
浏览器兼容性
Feature |
Chrome |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari (WebKit) |
---|---|---|---|---|---|
Basic support |
No support |
41.0 (41.0)1 |
No support |
No support |
No support |
Feature |
Android |
Firefox Mobile (Gecko) |
IE Phone |
Opera Mobile |
Safari Mobile |
---|---|---|---|---|---|
Basic support |
No support |
41.0 (41.0)1 |
No support |
No support |
No support |
逻辑属性 | Logical Properties相关
层叠样式表( Cascading Style Sheets )是一种用来表现 HTML 或 XML 等文件样式的计算机语言。CSS 不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。