边界块启动 | border-block-start (Logical Properties) - CSS 中文开发手册 - Break易站
边界块启动 | border-block-start (Logical Properties) - CSS 中文开发手册
这是一项实验技术
由于该技术的规格不稳定,请查看兼容性表以了解各种浏览器的使用情况。还请注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。
border-block-start CSS 属性是在样式表一个单一的地方设置单独的逻辑块开始 border 属性值的速记属性。
border-block-start: 1px; border-block-start: 2px dotted; border-block-start: medium dashed blue;
border-block-start可用于对一个或多个的设置的值border-block-start-width,border-block-start-style和border-block-start-color。它映射的物理边界取决于元素的写入模式,方向性和文本方向。它对应于border-top,border-right,border-bottom,或border-left属性根据为定义的值writing-mode,direction和text-orientation。
相关属性是border-block-end,border-inline-start和border-inline-end,它们定义了元素的其他边界。
Initial value | as each of the properties of the shorthand: border-width: as each of the properties of the shorthand: border-top-width: medium border-right-width: medium border-bottom-width: medium border-left-width: medium border-style: as each of the properties of the shorthand: border-top-style: none border-right-style: none border-bottom-style: none border-left-style: none color: Varies from one browser to another |
---|---|
Applies to | all elements |
Inherited | no |
Media | visual |
Computed value | as each of the properties of the shorthand: border-width: as each of the properties of the shorthand: border-bottom-width: the absolute length or 0 if border-bottom-style is none or hidden border-left-width: the absolute length or 0 if border-left-style is none or hidden border-right-width: the absolute length or 0 if border-right-style is none or hidden border-top-width: the absolute length or 0 if border-top-style is none or hidden border-style: as each of the properties of the shorthand: border-bottom-style: as specified border-left-style: as specified border-right-style: as specified border-top-style: as specified color: If the value is translucent, the computed value will be the rgba() corresponding one. If it isn't, it will be the rgb() corresponding one. The transparent keyword maps to rgba(0,0,0,0). |
Animation type | discrete |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
border-width:作为速记的每个属性:
- [`border-top-width`](border-top-width): `medium` - [`border-right-width`](border-right-width): `medium` - [`border-bottom-width`](border-bottom-width): `medium` - [`border-left-width`](border-left-width): `medium`
border-style:作为速记的每个属性:
- [`border-top-style`](border-top-style): `none` - [`border-right-style`](border-right-style): `none` - [`border-bottom-style`](border-bottom-style): `none` - [`border-left-style`](border-left-style): `none`
color:因浏览器而异
Applies to all elements [Inherited](inheritance) no Media visual [Computed value](computed_value) as each of the properties of the shorthand:
border-width:作为速记的每个属性:
- [`border-bottom-width`](border-bottom-width): the absolute length or `0` if [`border-bottom-style`](border-bottom-style) is `none` or `hidden` - [`border-left-width`](border-left-width): the absolute length or `0` if [`border-left-style`](border-left-style) is `none` or `hidden` - [`border-right-width`](border-right-width): the absolute length or `0` if [`border-right-style`](border-right-style) is `none` or `hidden` - [`border-top-width`](border-top-width): the absolute length or `0` if [`border-top-style`](border-top-style) is `none` or `hidden`
border-style:作为速记的每个属性:
- [`border-bottom-style`](border-bottom-style): as specified - [`border-left-style`](border-left-style): as specified - [`border-right-style`](border-right-style): as specified - [`border-top-style`](border-top-style): as specified
color:如果该值是半透明的,则计算出的值将是rgba()相应的值。如果不是,那将是rgb()相应的一个。该transparent关键字映射到rgba(0,0,0,0)。
Animation type discrete Canonical order the unique non-ambiguous order defined by the formal grammar
语法
值
在border-block-start与一个或多个以下的规定,以任何顺序:
<'border-width'>边框的宽度。看border-width。
<'border-style'>边框的线条样式。看border-style。
<'color'>边框的颜色。看color。
形式语法
<'border-width'> || <'border-style'> || <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( [ [ <percentage>{3} | <number>{3} ] [ / <alpha-value> ]? ] | [ [ <percentage>#{3} | <number>#{3} ] , <alpha-value>? ] )<rgba()> = rgba( [ [ <percentage>{3} | <number>{3} ] [ / <alpha-value> ]? ] | [ [ <percentage>#{3} | <number>#{3} ] , <alpha-value>? ] )<hsl()> = hsl( [ <hue> <percentage> <percentage> [ / <alpha-value> ]? ] | [ <hue>, <percentage>, <percentage>, <alpha-value>? ] )<hsla()> = hsla( [ <hue> <percentage> <percentage> [ / <alpha-value> ]? ] | [ <hue>, <percentage>, <percentage>, <alpha-value>? ] )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle>
例子
HTML 内容
<div> <p class="exampleText">Example text</p> </div>
CSS 内容
div { background-color: yellow; width: 120px; height: 120px; } .exampleText { writing-mode: vertical-rl; border-block-start: 5px dashed blue; }
规范
Specification | Status | Comment |
---|---|---|
CSS Logical Properties Level 1The definition of 'border-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 |