Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The -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.
This property is a shorthand for the following CSS properties:
/* 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: revert; -webkit-border-before: revert-layer; -webkit-border-before: unset;
One or more of the following, in any order:
The -webkit-border-before property 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, or border-left property depending on the values defined for writing-mode, direction, and text-orientation.
It relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element.
The standard-track equivalent of this property is border-block-start.
| Initial value | as each of the properties of the shorthand:
|
|---|---|
| Applies to | all elements |
| Inherited | yes |
| Percentages | as each of the properties of the shorthand:
|
| Computed value | as each of the properties of the shorthand:
|
| Animation type | discrete |
-webkit-border-before =
<'border-width'> ||
<'border-style'> ||
<color>
<border-width> =
<line-width>{1,4}
<border-style> =
<line-style>{1,4}
<line-width> =
<length [0,∞]> |
thin |
medium |
thick
<line-style> =
none |
hidden |
dotted |
dashed |
solid |
double |
groove |
ridge |
inset |
outset
<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 property.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
-webkit-border-before |
8 | 79 | No | 15 | 5.1 | 18 | No | 15 | 5 | 1.0 | 3 | 5 |
border-block-startborder-top, border-right, border-bottom, and border-left
writing-mode, direction, text-orientation
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-border-before