border-block
CSS
特性为
shorthand property
for setting the individual logical block border property values in a single place in the style sheet.
border-block: 1px; border-block: 2px dotted; border-block: medium dashed blue;
border-block
can be used to set the values for one or more of
border-block-width
,
border-block-style
,和
border-block-color
setting both the start and end in the block dimension at once. The physical borders to which it maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the
border-top
and
border-bottom
or
border-right
,和
border-left
properties depending on the values defined for
writing-mode
,
direction
,和
text-orientation
.
The borders in the other dimension can be set with
border-inline
, which sets
border-inline-start
,和
border-inline-end
.
此特性是下列 CSS 特性的简写:
border-block
is specified with one or more of the following, in any order:
<'border-width'>
border-width
.
<'border-style'>
border-style
.
<'color'>
color
.
| 初始值 |
as each of the properties of the shorthand:
|
|---|---|
| 适用于 | 所有元素 |
| 继承 | no |
| 计算值 |
as each of the properties of the shorthand:
|
| 动画类型 | discrete |
<'border-top-width'> || <'border-top-style'> || <'color'>where
<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where
<rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )
<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )
<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )
<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where
<alpha-value> = <number> | <percentage>
<hue> = <number> | <angle>
<div> <p class="exampleText">Example text</p> </div>
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-rl;
border-block: 5px dashed blue;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Logical Properties and Values Level 1
The definition of 'border-block' in that specification. |
编者草案 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
border-block
|
Chrome 完整支持 69 | Edge 完整支持 79 | Firefox 完整支持 66 | IE 不支持 No | Opera 完整支持 56 | Safari 不支持 No | WebView Android 完整支持 69 | Chrome Android 完整支持 69 | Firefox Android 完整支持 66 | Opera Android 完整支持 48 | Safari iOS 不支持 No | Samsung Internet Android 完整支持 10.0 |
完整支持
不支持
border-top
,
border-right
,
border-bottom
,或
border-left
.
writing-mode
,
direction
,
text-orientation
block-size
border-block
border-block-color
border-block-end
border-block-end-color
border-block-end-style
border-block-end-width
border-block-start
border-block-start-color
border-block-start-style
border-block-start-width
border-block-style
border-block-width
border-end-end-radius
border-end-start-radius
border-inline
border-inline-color
border-inline-end
border-inline-end-color
border-inline-end-style
border-inline-end-width
border-inline-start
border-inline-start-color
border-inline-start-style
border-inline-start-width
border-inline-style
border-inline-width
border-start-end-radius
border-start-start-radius
inline-size
inset
inset-block
inset-block-end
inset-block-start
inset-inline
inset-inline-end
inset-inline-start
margin-block
margin-block-end
margin-block-start
margin-inline
margin-inline-end
margin-inline-start
max-block-size
max-inline-size
min-block-size
min-inline-size
padding-block
padding-block-end
padding-block-start
padding-inline
padding-inline-end
padding-inline-start