Перейти к содержимому

Свойство CSS column-rule-style

Свойство column-rule-style задаёт стиль линии между колонками. Линия между колонками похожа на border, который можно добавить для разделения соседних колонок. Она также может иметь стили, как у рамки.

Это свойство является одним из CSS3 properties.

Чтобы использовать это свойство, сначала нужно определить колонки с помощью свойств columns или column-count.

Свойство column-rule-style имеет следующие значения:

  • none
  • hidden
  • dotted
  • dashed
  • solid
  • double
  • groove
  • ridge
  • inset
  • outset
Initial Valuenone
Applies toMulticol elements.
InheritedNo.
AnimatableNo.
VersionCSS3
DOM Syntaxobject.style.columnRuleStyle = "dashed" ;

Синтаксис

Синтаксис свойства CSS column-rule-style

css
column-rule-style: none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset | initial | inherit;

Пример свойства column-rule-style:

Пример свойства CSS column-rule-style со значением dotted

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        column-count: 3;
        column-gap: 30px;
        column-rule-style: dotted;
      }
    </style>
  </head>
  <body>
    <h2>Column-rule-style property example</h2>
    <div>
      Lorem Ipsum is dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    </div>
  </body>
</html>

Результат

SS column-rule-style Property

В следующем примере линии между колонками имеют двойной стиль. В этом примере цвет для линии задаётся с помощью свойства column-rule-color.

Пример свойства column-rule-style со значением "double":

Пример свойства CSS column-rule-style со значением double

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        column-count: 3;
        column-gap: 30px;
        column-rule-style: double;
        column-rule-color: #1c87c9;
        column-rule-width: 5px;
        text-align: justify;
      }
    </style>
  </head>
  <body>
    <h1>Column-rule-style property example</h1>
    <div>
      Lorem Ipsum is dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    </div>
  </body>
</html>

Значения

ValueDescription
noneЛиния не задаётся. Это значение по умолчанию.
hiddenЛиния скрыта.
dottedЛиния пунктирная.
dashedЛиния штриховая.
solidЛиния сплошная.
doubleЛиния двойная.
grooveЛиния имеет 3D-эффект groove. Значения width и color определяют эффект.
ridgeЛиния имеет 3D-эффект ridge. Значения width и color определяют эффект.
insetЛиния имеет 3D-эффект inset. Значения width и color определяют эффект.
outsetЛиния имеет 3D-эффект outset. Значения width и color определяют эффект.
initialУстанавливает свойство в значение по умолчанию.
inheritНаследует свойство от родительского элемента.

Practice

Какие из следующих утверждений верны о свойстве CSS column-rule-style?

Считаете ли это полезным?

Предпросмотр dual-run — сравните с маршрутами Symfony на продакшене.