Add a rule between CSS grid columns and rows

前端 未结 6 1752
青春惊慌失措
青春惊慌失措 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条回答
  •  星月不相逢
    2021-01-01 21:06

    Another option you could do would be to target a specific div and designate that as your horizontal rule column by having it span multiple columns.

      .wrapper {
    			display: grid;
    			grid-template-columns: 1fr 2fr 1fr;
    		}
    
    		.wrapper>div {
    
    			background-color: #eee;
    			padding: 1em;
    		}
    
    		.fullRow {
    			grid-column: 1/ 4;
    		}
    first column
    second column
    third column

    first column
    second column
    third column

提交回复
热议问题