<!-- 实例演示Grid常用的容器与项目属性 -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="container">
<div class="kcb">kcb1</div>
</div>
<style>
.container {
width:900px;
height:600px;
display:grid;
grid-template-columns: repeat(5,1fr);
grid-template-rows: repeat(5,1fr);
}
.container > .kcb {
background-color:blueviolet;
}
.container > .kcb:first-child {
display:grid;
grid-area:1 /2 /3 /4 ;
gap:2px;
color:blue;
}
</style>
</body>
</html>