CSS Grid

时间:2023-11-24 20:19:08
CSS Grid

效果图如上所示

<!DOCTYPE html>
<html>
<head>
<title>练习</title> </head>
<body>
<link rel="stylesheet" type="text/css" href="file:///D:/Sublime%20Text%203/Sublime%20Text%203/%E4%BB%A3%E7%A0%81/Css%E5%AE%9E%E9%AA%8C">
<div class="container">
<div class="one">One</div>
<div class="two">Two</div>
<div class="three">Three</div>
<div class="four">Four</div>
<div class="five">Five</div>
<div class="six">Six</div>
</div>
</body>
</html>
.container{
display: grid;
grid-template-columns: 60px 60px 60px;
grid-auto-rows: 60px 60px 60px 60px;
background: pink;
color: purple;
}
.one{
grid-column-start:;
grid-row-start:;
grid-row-end:;
grid-column-end:;
background: orange;
}
.two{
grid-column-start:;
grid-row-start:;
grid-column-end:;
grid-row-end:;
background: green;
}
.three{
grid-column-start:;
grid-row-start:;
grid-column-end:;
grid-row-end:;
background: black;
}
.four{
grid-column-start:;
grid-row-start:;
grid-row-end:;
grid-column-end:;
background: yellow;
}
.five{
grid-column-start:;
grid-row-start:;
grid-column-end:;
grid-row-end:;
background: red;
}
.six{
grid-column-start:;
grid-row-start:;
grid-column-end:;
grid-row-end:;
background:blue;
}

相关文章