

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
CSS grid-template-columns property
The grid-template-columns property is used to set the number of columns in the Grid.
Example
You can try to run the following code to implement the grid-template-columns property −
<!DOCTYPE html> <html> <head> <style> .container { display: grid; background-color: blue; grid-template-columns: auto auto; padding: 20px; grid-gap: 20px; } .container > div { background-color: orange; border: 2px solid gray; padding: 35px; font-size: 30px; text-align: center; } </style> </head> <body> <h1>Game Board</h1> <div class = "container"> <div class = "ele1">1</div> <div class = "ele2">2</div> <div class = "ele3">3</div> <div class = "ele4">4</div> <div class = "ele5">5</div> <div class = "ele6">6</div> </div> </body> </html>
- Related Questions & Answers
- CSS grid-template-rows property
- Set the grid template property in CSS
- Usage of CSS grid-auto-columns property
- CSS Grid Columns
- CSS grid-row Property
- CSS grid-area Property
- Usage of CSS grid property
- Usage of CSS grid-gap property
- Usage of CSS grid-row-gap property
- Usage of CSS grid-column-gap property
- Usage of CSS grid-column-start property
- Usage of CSS grid-row-end property
- Usage of CSS grid-row-start property
- Usage of CSS grid-auto-rows property
- Usage of CSS grid-column-end property
Advertisements