Firefox Tomorrow

css shorthand property

`-webkit-border-before` CSS property

View on MDN ↗

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.

Constituent properties

This property is a shorthand for the following CSS properties:

Syntax

/* 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;

Values

One or more of the following, in any order:

Description

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.

Formal definition

Formal syntax

-webkit-border-before = <border-width> || <border-style> || <color>

Examples

Applying a border with vertical text

HTML

<div>
  <p class="exampleText">Example text</p>
</div>

CSS

div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}

.exampleText {
  writing-mode: vertical-rl;
  -webkit-border-before: 5px dashed blue;
}

Result

Interactive exampleOpen the canonical MDN source to run this embedded demo.

Specifications

Not part of any standard, but it relates to the standards-track border-block-start property.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also