Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Multiple Columns in CSS

Multiple Columns in CSS

? Multiple Columns in CSS

CSS Multi-column Layout allows you to easily split content into multiple columns, similar to a newspaper or magazine layout.


Core Properties

PropertyDescription
column-countNumber of columns you want
column-widthIdeal width of each column
column-gapSpace between columns
column-ruleAdds a line (border) between columns
column-rule-widthThickness of the column rule
column-rule-styleStyle of the rule (solid, dashed, etc.)
column-rule-colorColor of the rule
columnsShorthand for column-width and column-count

Basic Example

.article {  column-count: 3;  column-gap: 20px;}

Splits .article content into 3 columns with 20px space between.


Using column-width

.article {  column-width: 200px;  column-gap: 15px;}

The browser will create as many columns of ~200px width as will fit.


Adding a Column Rule (separator line)

.article {  column-count: 2;  column-gap: 30px;  column-rule: 2px solid #ccc;}

Shorthand: columns

.article {  columns: 3 150px; /* 3 columns with ~150px width each */}

Notes

  • Content flows from the top of the first column down and then continues at the top of the next.

  • Works well for text-heavy layouts.

  • Not supported in older browsers, but widely supported in modern browsers.


Example with HTML

<div class="article">  <p>Paragraph 1...</p>  <p>Paragraph 2...</p>  <p>Paragraph 3...</p>  <!-- More paragraphs --></div>

With the CSS above, paragraphs flow evenly across columns.


Want me to help you create a multi-column layout with responsive adjustments?

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql