CSS Grid-gap Property - Dofactory
Có thể bạn quan tâm
- SQL
SQL Tutorial SQL Reference Connection Strings
- .NET
C# Design Patterns C# Coding Standards C# Code Examples Visual Studio Shortcut Keys
- HTML
HTML Tutorial HTML Reference
- CSS
CSS Tutorial CSS Reference
- JavaScript
JavaScript Tutorial JavaScript Design Patterns
- SQL
- .NET
- HTML
- CSS
- JavaScript
Select tutorial
Select tutorial
Select tutorial
Select tutorial
Select tutorial
Back to CSS Select Tutorial - HTML Tutorial
- HTML Reference
- CSS Tutorial
- CSS Reference
- SQL Tutorial
- SQL Reference
- JavaScript Tutorial
- JavaScript Patterns
- C# Design Patterns
- C# Coding Standards
- Connection Strings
- Visual Studio Shortcuts
The grid-gap is the space between grid rows and columns.
It accepts any length value, such as, px, %, em, and others.
The default is 0, meaning no gaps between rows and columns.
Example
#
A grid with a grid-gap of 25 pixels.
1 2 3 4 5 6 7 8 9 10 11 <style> .grid-container { background-color: steelblue; padding: 10px; display: grid; grid-gap: 25px; grid-template-columns: auto auto auto auto; } .grid-container > div { background-color: aliceblue; text-align: center; padding: 15px 5px; font-size: 18px; } </style> <div class="grid-container"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div> <div>10</div> <div>11</div> </div> Try it liveUsing grid-gap
#
The grid-gap property is a shorthand property for:
- grid-row-gap
- grid-column-gap
The grid-gap property is synonymous with gap. They can be used interchangeably.
grid-column-start grid-rowSyntax
#
grid-gap: grid-row-gap grid-column-gap;Values
#
| Value | Description |
|---|---|
| grid-row-gap | Space between the rows. Default value is 0. |
| grid-column-gap | Space between the columns. Default value is 0. |
Note: If only one value is specified, it will be used for both row and column gap values.
Browser support
#
This table shows when grid-gap support started for each browser.
Chrome | 57 | Mar 2017 |
Firefox | 52 | Mar 2017 |
IE/Edge | 16 | Sep 2017 |
Opera | 44 | Mar 2017 |
Safari | 10 | Sep 2016 |
You may also like
#
- Our CSS grid-row-gap Property Reference
- Our CSS grid-column-gap Property Reference
- Our CSS Grid Tutorial
- Our HTML Layout Tutorial
Jack Poorte Last updated on Sep 30, 2023 Earn income with your CSS skills Sign up and we'll send you the best freelance opportunities straight to your inbox. We're building the largest freelancing marketplace for people like you. Send Me Opportunities By adding your name & email you agree to our terms, privacy and cookie policies. Feedback Guides - CSS Tutorial
- CSS Selectors
- CSS Borders
- CSS Flex
- CSS Grid
- CSS Tables
- CSS Length
- CSS Fonts
- CSS Animation
- CSS Hover
- CSS Images
- CSS Comments
- CSS grid-gap
- Example
- Using
- Syntax
- Values
- Browser support
- You may also like
Từ khóa » Html Grid Column Gap
-
Column-gap (grid-column-gap) - CSS: Cascading Style Sheets | MDN
-
Gap (grid-gap) - CSS: Cascading Style Sheets - MDN Web Docs
-
CSS Grid-column-gap Property - W3Schools
-
CSS Grid-gap Property - W3Schools
-
Column-gap - CSS-Tricks
-
A Complete Guide To Grid - CSS-Tricks
-
CSS Grid Dynamic Columns Auto-fit - Gap Between Columns
-
Gap - Tailwind CSS
-
Grid-column-gap - CSS - W3cubDocs
-
Grid Gap CSS - Linux Hint
-
CSS | Grid-gap Property - GeeksforGeeks
-
Column-gap - CSS - W3cubDocs
-
CSS Grid-column-gap Property - W3docs
-
Aligning The Grid With Space-around And Space-between
Chrome
Firefox
IE/Edge
Opera
Safari