Add a rule between CSS grid columns and rows

前端 未结 6 1740
青春惊慌失措
青春惊慌失措 2021-01-01 20:47

Is there a css grid property to add a rule (vertical line) between grid columns, and a rule (horizontal line) between grid rows, in the same way, or similar, that column-rul

6条回答
  •  旧时难觅i
    2021-01-01 21:29

    As @Paulie_D said, no there isn't. You would have to do something as hideous as this to get something even close it it - you can't even use grid-gap if you do this:

    #grid{
      display: inline-grid;
      grid-template-rows: auto 2px auto 2px auto;
      grid-template-columns: auto 2px auto 2px auto;
    }
    .item{
      width: 5rem;
      height: 5rem;
      background: red; 
    }
    .rule{
      background:black;
    }

提交回复
热议问题