column-rule-width

Term side of the Card.
Topic: Columns & Tables
Unit title: column-rule-width
Categories: Property
Explanation side of the Card

Explanation: The property that sets the thickness (width) of the line (rule) between columns in a multi-column layout. It can be adjusted to make the line more prominent or subtle, depending on the design needs.

Browser compatibility:
  • The chrome browser supports this feature starting from version 50.
  • The edge browser supports this feature starting from version 12.
  • The firefox browser supports this feature starting from version 52.
  • The safari browser supports this feature starting from version 9.
Availability: 

Example

Wrongcss
.text {
  columns: 2;
  column-gap: 4px;
  column-rule: 8px solid #ccc;
}
Rightcss
.text {
  columns: 2;
  column-gap: 2rem;
  column-rule: 2px solid #ccc;
}

The rule is painted inside the gap, so the gap must be wider than the rule to keep it off the text.

Common mistakes

  • A wide rule overlaps column content, because it doesn't add space.

Key points

  • The rule width is not larger than column-gap, so it doesn't overlap text.
  • A column-rule-style is set, or the rule is not drawn at any width.

Interview questions

What keywords does column-rule-width accept?

'thin', 'medium' and 'thick', or any length like '2px'. The default is 'medium'.

Does column-rule-width change the width of columns?

No. The rule is painted inside the gap and doesn't affect layout.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy