标签:开始 布局 浏览器 gap 情况 ref 目的 相同 rap
1 .contain{ 2 display:grid; 3 grid-template-rows: 100px 100px 100px; 4 grid-template-columns:100px 100px 100px; 5 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(4,33%); 4 grid-template-columns:repeat(3,33%); 5 } 6 //或 7 .contain{ 8 display:grid; 9 grid-template-rows: repeat(4,100px 20px 80px); 10 grid-template-columns:repeat(4,100px 20px 80px); 11 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(4,100px); 4 grid-template-columns:repeat(3,1fr); 5 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:1fr 1fr minmax(300px, 1fr);; 5 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:200px auto 200px; 5 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:[c1] 100px [c2] 100px [c3] auto; 5 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:70% 30%; 5 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:200px 200px 200px; 5 grid-row-gap: 20px; 6 grid-column-gap: 20px; 7 }
grip-gap:<grip-row-gap><grip-column-gap>
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:200px 200px 200px; 5 grid-gap: 10px 30px; 6 grid-template-areas: ‘a a a‘ ‘b c d‘ ‘e f g‘ ; 7 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:200px 200px 200px; 5 grid-gap: 10px 30px; 6 grid-template-areas: ‘a a a‘ ‘b c d‘ ‘e f g‘ ; 7 grid-auto-flow:row; 8 } 9 10 11 /* 或 */ 12 .contain{ 13 display:grid; 14 grid-template-rows: repeat(5,100px); 15 grid-template-columns:200px 200px 200px; 16 grid-gap: 10px 30px; 17 grid-template-areas: ‘a a a‘ ‘b c d‘ ‘e f g‘ ; 18 grid-auto-flow:column; 19 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:200px 200px 200px; 5 grid-gap: 10px 30px; 6 grid-auto-flow:column dense; 7 //或 8 //grid-auto-flow:row dense 9 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:200px 200px 200px; 5 grid-gap: 10px 30px; 6 grid-auto-flow:column dense; 7 justify-items: end; 8 align-items:end; 9 //或 place-items:end end; 10 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(5,100px); 4 grid-template-columns:200px 200px 200px; 5 grid-gap: 10px 30px; 6 grid-auto-flow:column dense; 7 justify-content: end; 8 align-items: end; 9 //place-content: end start; 10 }
1 .contain{ 2 display:grid; 3 grid-template-rows: repeat(3,100px); 4 grid-template-columns:200px 200px; 5 grid-auto-rows: 300px; 6 }
1 .bgcolor2{ 2 grid-column-start: 1; 3 grid-column-end: 2; 4 grid-row-start: 2; 5 grid-row-end: 4; 6 }
1 .grid1{ 2 background-color: aliceblue; 3 grid-column-start: span 3; 4 }
1 .grid2{ 2 background-color: aqua; 3 grid-column: 1 / 3; 4 grid-row:1 / 3; 5 } 6 //等价于 7 .grid2{ 8 background-color: aqua; 9 grid-column-start:1; 10 grid-column-end:3; 11 grid-row-start:1; 12 grid-row-end: 3; 13 }
1 .grid2{ 2 background-color: aqua; 3 grid-area: e; 4 // grid-area: 2 / 1 / 3 / 4; 5 }
grid-area: <row-start> / <column-start> / <row-end> / <column-end>;
1 .grid2{ 2 background-color: aqua; 3 justify-self: stretch; 4 align-self: center; 5 //place-self:stretch center; 6 }
标签:开始 布局 浏览器 gap 情况 ref 目的 相同 rap
原文地址:https://www.cnblogs.com/hongding/p/11332395.html