
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
Set the size of the gap between CSS grid columns
Use the grid-column-gap property to set the size of the gap between grid columns in CSS
Example
<!DOCTYPE html> <html> <head> <style> .container { display: grid; grid-auto-rows: 50px; grid-column-gap: 30px; grid-row-gap: 20px; background-color: #2E86C1; padding: 10px; } .container>div { background-color: #F2D7D5; text-align: center; padding:10px 0; font-size: 20px; } .ele3 { grid-column-end: span 2; } </style> </head> <body> <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 Articles
- How to specify the size of the gap between rows in CSS Grid
- Adjust gap size for CSS Grid
- Specify the gap between the columns with CSS
- Usage of CSS grid-gap property
- How to set the gap between the columns with JavaScript?
- Usage of CSS grid-row-gap property
- Usage of CSS grid-column-gap property
- Set a default row size for CSS Grid
- CSS Grid Columns
- Set the color of the rule between columns with CSS
- Set the style of the rule between columns with CSS
- Set the width of the rule between columns with CSS
- How to set a default column size in CSS Grid
- Define the number of columns in CSS Grid Layout
- CSS grid-template-columns property

Advertisements