column-rule

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.

Die column-rule Kurzschreibweise der CSS-Eigenschaft legt die Breite, den Stil und die Farbe der Linie fest, die zwischen Spalten in einem mehrspaltigen Layout gezogen wird.

Probieren Sie es aus

column-rule: dotted;
column-rule: solid 6px;
column-rule: solid blue;
column-rule: thick inset blue;
<section id="default-example">
  <p id="example-element">
    London. Michaelmas term lately over, and the Lord Chancellor sitting in
    Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
    as if the waters had but newly retired from the face of the earth, and it
    would not be wonderful to meet a Megalosaurus, forty feet long or so,
    waddling like an elephantine lizard up Holborn Hill.
  </p>
</section>
#example-element {
  columns: 3;
  column-rule: solid;
  text-align: left;
}

Zusätzliche Eigenschaften

Diese Eigenschaft ist eine Kurzschreibweise für die folgenden CSS-Eigenschaften:

Syntax

css
column-rule: dotted;
column-rule: solid 8px;
column-rule: solid blue;
column-rule: thick inset blue;

/* Global values */
column-rule: inherit;
column-rule: initial;
column-rule: revert;
column-rule: revert-layer;
column-rule: unset;

Werte

Die column-rule-Eigenschaft wird als ein, zwei oder drei der unten aufgelisteten Werte angegeben, in beliebiger Reihenfolge.

<'column-rule-width'>

Ist ein <length> oder eines der drei Schlüsselwörter, thin, medium oder thick. Weitere Details finden Sie unter border-width.

<'column-rule-style'>

Weitere Details und mögliche Werte finden Sie unter border-style.

<'column-rule-color'>

Ist ein <color>-Wert.

Formale Definition

Anfangswertwie die jeweiligen Kurzschreibweisen:
Anwendbar aufmehrspaltige Elemente
VererbtNein
Berechneter Wertwie die jeweiligen Kurzschreibweisen:
Animationstypwie die jeweiligen Kurzschreibweisen:

Formale Syntax

column-rule = 
<gap-rule-list> |
<gap-auto-rule-list>

<gap-rule-list> =
<gap-rule-or-repeat> [ / <gap-rule-or-repeat> ]*

<gap-auto-rule-list> =
[ [ <gap-rule-or-repeat> ] / ]* <gap-auto-repeat-rule> [ / [ <gap-rule-or-repeat> ] ]*

<gap-rule-or-repeat> =
<gap-rule> |
<gap-repeat-rule>

<gap-auto-repeat-rule> =
repeat( auto , [ <gap-rule> ]# )

<gap-rule> =
<line-width> ||
<line-style> ||
<color>

<gap-repeat-rule> =
repeat( [ <integer [1,∞]> ] , [ <gap-rule> ]# )

<line-width> =
<length [0,∞]> |
thin |
medium |
thick

<line-style> =
none |
hidden |
dotted |
dashed |
solid |
double |
groove |
ridge |
inset |
outset

Beispiele

Beispiel 1

css
/* Same as "medium dotted currentcolor" */
p.foo {
  column-rule: dotted;
}

/* Same as "medium solid blue" */
p.bar {
  column-rule: solid blue;
}

/* Same as "8px solid currentcolor" */
p.baz {
  column-rule: solid 8px;
}

p.abc {
  column-rule: thick inset blue;
}

Beispiel 2

HTML

html
<p class="content-box">
  This is a bunch of text split into three columns. Take note of how the
  `column-rule` property is used to adjust the style, width, and color of the
  rule that appears between the columns.
</p>

CSS

css
.content-box {
  padding: 0.3em;
  background: #ff7;
  column-count: 3;
  column-rule: inset 2px #33f;
}

Ergebnis

Spezifikationen

Specification
CSS Multi-column Layout Module Level 1
# column-rule

Browser-Kompatibilität

BCD tables only load in the browser

Siehe auch