--- id: 5a9036ee38fddaf9a66b5d35 title: 使用 grid-column-gap 創建多列之間的間距 challengeType: 0 videoUrl: 'https://scrimba.com/p/pByETK/cVZ8vfD' forumTopicId: 301124 dashedName: create-a-column-gap-using-grid-column-gap --- # --description-- 目前爲止,在你所創建的網格中,每列都相互緊挨着。 有時候你想要列之間有一個間距。 如果需要在列與列之間添加一些間距,我們可以使用 `grid-column-gap`: ```css grid-column-gap: 10px; ``` 這會爲我們創建的所有列之間都添加 10px 的空白間距。 # --instructions-- 請爲網格中的所有列添加寬度爲 `20px` 的間距。 # --hints-- class 爲 `container` 的元素應具有 `grid-column-gap` 屬性且屬性值應爲 `20px`。 ```js assert( code.match( /.container\s*?{[\s\S]*grid-column-gap\s*?:\s*?20px\s*?;[\s\S]*}/gi ) ); ``` # --seed-- ## --seed-contents-- ```html