Collapsing borders using CSS Grid

前端 未结 3 1243
谎友^
谎友^ 2020-12-29 03:04

I\'m having fun getting my head around the new CSS Grid spec, but I\'m running into trouble with borders.

Is it possible to collapse borders in a CSS Grid,

3条回答
  •  再見小時候
    2020-12-29 03:53

    Another approach you could take if you were ok with the gap border color being the same as the day cells that don't fall on the current month is to wrap a div around the entire grid container and set its background-color to the color you want your borders to be and give it 1px of padding with a grid-gap of 1px. With this approach you're able to achieve a uniformly bordered grid without the complexity of using box-shadow, which feels like a hack to me.

提交回复
热议问题