非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
-webkit-border-before
CSS
property is a shorthand property for setting the individual logical block start border property values in a single place in the style sheet.
/* Border values */ -webkit-border-before: 1px; -webkit-border-before: 2px dotted; -webkit-border-before: medium dashed blue; /* Global values */ -webkit-border-before: inherit; -webkit-border-before: initial; -webkit-border-before: unset;
-webkit-border-before
can be used to set the values for one or more of:
-webkit-border-before-width
,
-webkit-border-before-style
,和
-webkit-border-before-color
. It maps to a physical border depending on the element's writing mode, directionality, and text orientation. It corresponds to the
border-top
,
border-right
,
border-bottom
,或
border-left
property depending on the values defined for
writing-mode
,
direction
,和
text-orientation
.
It relates to
-webkit-border-after
,
-webkit-border-start
,和
-webkit-border-end
, which define the other borders of the element.
This property is on the standard track as
border-block-start
.
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:
|
|---|---|
| 适用于 | 所有元素 |
| 继承 | yes |
| 百分比 |
as each of the properties of the shorthand:
|
| 计算值 |
as each of the properties of the shorthand:
|
| 动画类型 | discrete |
<'border-width'> || <'border-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;
-webkit-border-before: 5px dashed blue;
}
Not part of any standard, but it relates to the standards-track
border-block-start
特性。
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-webkit-border-before
非标
|
Chrome 完整支持 8 | Edge 完整支持 79 | Firefox 不支持 No | IE 不支持 No | Opera 完整支持 15 | Safari 完整支持 5.1 | WebView Android 完整支持 37 | Chrome Android 完整支持 18 | Firefox Android 不支持 No | Opera Android 完整支持 15 | Safari iOS 完整支持 5.1 | Samsung Internet Android 完整支持 1.0 |
完整支持
不支持
非标。预期跨浏览器支持较差。
border-block-start
border-top
,
border-right
,
border-bottom
,和
border-left
writing-mode
,
direction
,
text-orientation
-webkit-border-before
-webkit-box-reflect
-webkit-line-clamp
-webkit-mask-attachment
-webkit-mask-composite
-webkit-mask-position-x
-webkit-mask-position-y
-webkit-mask-repeat-x
-webkit-mask-repeat-y
-webkit-overflow-scrolling
-webkit-tap-highlight-color
-webkit-text-fill-color
-webkit-text-stroke
-webkit-text-stroke-color
-webkit-text-stroke-width
-webkit-touch-callout
box-align
box-direction
box-flex
box-flex-group
box-lines
box-ordinal-group
box-orient
box-pack