CSS | columns Property
In CSS the columns property is used to set the number of columns and the width of the columns. This is a shorthand property and can take multiple values at a time.
Syntax:
columns: column-width columns-count | auto | initial | inherit;
PropertyValues:
- auto: This sets the column-width and column-count values to their browser default values.
Syntax:
columns: auto auto;
Example 1: Using auto as the value.
<!DOCTYPE html><html><head><title>CSS | columns Property</title><style>body {text-align: center;color: green;}.GFG {-webkit-columns: auto auto;/* Chrome, Safari, Opera */-moz-columns: auto auto;/* Firefox */columns: auto auto;}</style></head><body><h1>The column Property</h1><divclass="GFG"><h2>Welcome to the world of Geeks!!</h2>How many times were you frustrated whilelooking out for a good collection ofprogramming/algorithm/interview questions?What did you expect and what did you get?This portal has been created to provide wellwritten, well thought and well-explainedsolutions for selected questions.<p><strong>Our team includes:</strong><p>Sandeep Jain: An IIT Roorkee alumnusand founder of GeeksforGeeks. He lovesto solve programming problems in mostefficient ways. Apart from GeeksforGeeks,he has worked with DE Shaw and Co. as asoftware developer and JIIT Noida as anassistant professor.</p><p>Vaibhav Bajpai: Amazed by computerscience,he is a technology enthusiast whoenjoys being a part of a development. Offfrom work, you canfind him in love withmovies, food, and friends.</p><p>Shikhar Goel: A Computer Science graduatewho likes to make things simpler. When he'snot working, you can find him surfing the web,learning facts, tricks and life hacks.He also enjoys movies in his leisure time.</p><p>Dharmesh Singh: A software developer whois always trying to push boundaries in searchof great breakthroughs. Off from his desk,you can find him cheering up his buddiesand enjoying life.</p><p>Shubham Baranwal: A passionate developerwho always tries to learn new technology andsoftware. In his free time, either he readssome articles or learns some other stuff.</p></p></div></body></html>chevron_rightfilter_noneOutput:

Note: If any of the values among the column-width and column-count are not specified, then the browser assumes their value as auto by default.
- integer: This is used to specify the column-width and the column-count using integer values.
Syntax:
columns: column-width column-count;
Example 2:
<!DOCTYPE html><html><head><title>CSS | columns Property</title><style>body {text-align: center;color: green;}.GFG {-webkit-columns: 60px 5;/* Chrome, Safari, Opera */-moz-columns: 60px 5;/* Firefox */columns: 60px 5;}</style></head><body><h1>The column Property</h1><divclass="GFG"><h2>Welcome to the world of Geeks!!</h2>How many times were you frustrated whilelooking out for a good collection ofprogramming/algorithm/interview questions?What did you expect and what did you get?This portal has been created to provide wellwritten, well thought and well-explainedsolutions for selected questions.<p><strong>Our team includes:</strong><p>Sandeep Jain: An IIT Roorkee alumnusand founder of GeeksforGeeks. He lovesto solve programming problems in mostefficient ways. Apart from GeeksforGeeks,he has worked with DE Shaw and Co. as asoftware developer and JIIT Noida as anassistant professor.</p><p>Vaibhav Bajpai: Amazed by computerscience,he is a technology enthusiast whoenjoys being a part of a development. Offfrom work, you canfind him in love withmovies, food, and friends.</p><p>Shikhar Goel: A Computer Science graduatewho likes to make things simpler. When he'snot working, you can find him surfing the web,learning facts, tricks and life hacks.He also enjoys movies in his leisure time.</p><p>Dharmesh Singh: A software developer whois always trying to push boundaries in searchof great breakthroughs. Off from his desk,you can find him cheering up his buddiesand enjoying life.</p><p>Shubham Baranwal: A passionate developerwho always tries to learn new technology andsoftware. In his free time, either he readssome articles or learns some other stuff.</p></p></div></body></html>chevron_rightfilter_noneOutput:
- initial: Initializes the values to their initial default values.
Syntax:
columns: initial initial;
Example 3:
<!DOCTYPE html><html><head><title>CSS | columns Property</title><style>body {text-align: center;color: green;}.GFG {-webkit-columns: initial initial;/* Chrome, Safari, Opera */-moz-columns: initial initial;/* Firefox */columns: initial initial;}</style></head><body><h1>The column Property</h1><divclass="GFG"><h2>Welcome to the world of Geeks!!</h2>How many times were you frustrated whilelooking out for a good collection ofprogramming/algorithm/interview questions?What did you expect and what did you get?This portal has been created to provide wellwritten, well thought and well-explainedsolutions for selected questions.<p><strong>Our team includes:</strong><p>Sandeep Jain: An IIT Roorkee alumnusand founder of GeeksforGeeks. He lovesto solve programming problems in mostefficient ways. Apart from GeeksforGeeks,he has worked with DE Shaw and Co. as asoftware developer and JIIT Noida as anassistant professor.</p><p>Vaibhav Bajpai: Amazed by computerscience,he is a technology enthusiast whoenjoys being a part of a development. Offfrom work, you canfind him in love withmovies, food, and friends.</p><p>Shikhar Goel: A Computer Science graduatewho likes to make things simpler. When he'snot working, you can find him surfing the web,learning facts, tricks and life hacks.He also enjoys movies in his leisure time.</p><p>Dharmesh Singh: A software developer whois always trying to push boundaries in searchof great breakthroughs. Off from his desk,you can find him cheering up his buddiesand enjoying life.</p><p>Shubham Baranwal: A passionate developerwho always tries to learn new technology andsoftware. In his free time, either he readssome articles or learns some other stuff.</p></p></div></body></html>chevron_rightfilter_noneOutput:
- inherit: Inherits the value from its parent element.
Syntax:
columns: inherit inherit;
Example 4:
<!DOCTYPE html><html><head><title>CSS | columns Property</title><style>body {text-align: center;color: green;}.GFG {-webkit-columns: inherit inherit;/* Chrome, Safari, Opera */-moz-columns: inherit inherit;/* Firefox */columns: inherit inherit;}</style></head><body><h1>The column Property</h1><divclass="GFG"><h2>Welcome to the world of Geeks!!</h2>How many times were you frustrated whilelooking out for a good collection ofprogramming/algorithm/interview questions?What did you expect and what did you get?This portal has been created to provide wellwritten, well thought and well-explainedsolutions for selected questions.<p><strong>Our team includes:</strong><p>Sandeep Jain: An IIT Roorkee alumnusand founder of GeeksforGeeks. He lovesto solve programming problems in mostefficient ways. Apart from GeeksforGeeks,he has worked with DE Shaw and Co. as asoftware developer and JIIT Noida as anassistant professor.</p><p>Vaibhav Bajpai: Amazed by computerscience,he is a technology enthusiast whoenjoys being a part of a development. Offfrom work, you canfind him in love withmovies, food, and friends.</p><p>Shikhar Goel: A Computer Science graduatewho likes to make things simpler. When he'snot working, you can find him surfing the web,learning facts, tricks and life hacks.He also enjoys movies in his leisure time.</p><p>Dharmesh Singh: A software developer whois always trying to push boundaries in searchof great breakthroughs. Off from his desk,you can find him cheering up his buddiesand enjoying life.</p><p>Shubham Baranwal: A passionate developerwho always tries to learn new technology andsoftware. In his free time, either he readssome articles or learns some other stuff.</p></p></div></body></html></html>chevron_rightfilter_noneOutput:
Supported Browser: The browsers supported by columns Property are listed below:
- Chrome 50.0, 4.0 -webkit-
- Edge 10.0
- Firefox 52.0, 9.0 -moz-
- Opera 37.0, 15.0 -webkit- 11.1
- Safari 9.0, 3.1 -webkit-
Recommended Posts:
- CSS | grid-template-columns Property
- HTML | DOM Style columns Property
- CSS | grid-auto-columns Property
- CSS | Multiple Columns
- How to rename columns in Pandas DataFrame
- Collapse multiple Columns in Pandas
- How to create five equal columns in Bootstrap ?
- Difference of two columns in Pandas dataframe
- How to select multiple columns in a pandas dataframe
- Getting frequency counts of a columns in Pandas DataFrame
- How to drop one or multiple columns in Pandas Dataframe
- How to use Bootstrap to align labels with content into 4 columns ?
- Change Data Type for one or more columns in Pandas Dataframe
- Join two text columns into a single column in Pandas
- Split a text column into two columns in Pandas DataFrame
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



