123.png
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>columns</title>
</head>
<style>
body{
padding: 0;
margin: 0;
}
th{
background-color: green;
height: 50px;
border:0;
}
table{
width: 100%;
border-spacing: 0;
border:0;
}
.flex{
display: flex;
width: 100%;
height: 50px;
}
.flex .item{
background-color: pink;
flex: 1;
}
.grid {
display: grid;
grid-template-columns: auto auto auto;
}
.grid .item{
background-color: lightgreen;
height: 50px;
}
.cell{
width: 100%;
height: 50px;
display: table;
}
.cell .item{
display: table-cell;
height: 50px;
background-color: lightblue;
}
.column{
column-count: 3;
-webkit-column-count:3;
column-gap: 0;
}
.column .item{
background-color: purple;
height: 50px;
}
</style>
<body>
<table>
<thead>
<th></th>
<th></th>
<th></th>
</thead>
</table>
<div class="flex">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
<div class="grid">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
<div class="cell">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
<div class="column">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</body>
</html>
网友评论