Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions grid_layout_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>플렉스 박스 레이아웃</title>
<meta name="viewport" content="width=device-width, initial-scale=1 1">
<style>
.container {
width:1000px;
height:500px;
display:grid;
border:1px dashed #222;
/* grid-template-columns: 100px 200px 300px; */
grid-template-columns: repeat(3, 1fr);

/* grid-template-rows: 50px 100px ; */
/* grid-template-rows: minmax(100px, auto); */
grid-template-rows: repeat(2, 1fr);

}
.items{
border:1px solid #222;
padding:10px;
margin:10px;
text-align: center;
font-weight: bold;
font-size: 20px;
}
/* .box {
width: 100px;
height: 100px;
background-color: #2e4eb7;
border: 1px solid #222;
padding: 10px;
margin: 10px;
text-align: center;
font-weight: bold;

} */
.box:nth-child(odd) {
background-color: #1ed0e8;
}
.box:nth-child(even) {
background-color: #a6ff00;
}
p {
font-weight: bold;
text-align: center;
}

</style>
</head>
<body>
<div class="container">
<div class="box" id="box1"><p>1</p></div>
<div class="box" id="box2"><p>2</p></div>
<div class="box" id="box3"><p>3</p></div>
<div class="box" id="box4"><p>4</p></div>
<div class="box" id="box5"><p>5</p></div>
<div class="box" id="box6"><p>6</p></div>


</div>
</body>
</html>