728x90
반응형
<!DOCTYPE html>
<html lang="ko">
<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>
    <style>
        #wrapper {
            display: grid;
            width: 700px;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(3, 100px);
            grid-template-areas: 
                "box1 box1 box1"
                "box2 box3 box3"
                "box2 . box4"
            ;    
            grid-gap: 10px 10px;
        }
        .box {
            border: 1px solid black;
            color: white;
            text-align: center;
            font-weight: bold;
        }

        .box1{
            background-color: darkcyan;
            grid-area: box1;
        }
        .box2{
            background-color: rgb(1, 155, 103);
            grid-area: box2;
            grid-area: box2;
        }
        .box3{
            background-color: rgb(0, 190, 79);
            grid-area: box3;
        }
        .box4{
            background-color: rgb(103, 6, 141);
            grid-area: box4;
        }


    </style>
</head>
<body>
    <div id="wrapper">
        <div class="box box1">box1</div>
        <div class="box box2">box2</div>
        <div class="box box3">box3</div>
        <div class="box box4">box4</div>
    </div>
    
</body>
</html>
728x90
반응형

'코딩일지 > WEB' 카테고리의 다른 글

flex 설명  (0) 2023.01.01
grid실습  (0) 2023.01.01
grid 예제1  (0) 2023.01.01
flex 예제1  (0) 2022.12.29
animation 예제2  (0) 2022.12.29

+ Recent posts

">