CSS 마진(margin)

tpids·2024년 6월 2일

HTML, CSS

목록 보기
15/19
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }
        #div1{
            background-color: red;
        }
        #div2{    
            background-color: blanchedalmond;
            margin-left: 200px;

        }
        #div3{
            background-color: yellowgreen;
            margin-left: 400px;
        }
        #div4{        
            background-color: palevioletred;
            margin-left: 600px;
        }
    </style>
</head>
<body>
    <div id="div1"></div>
    <div id="div2"></div>
    <div id="div3"></div>
    <div id="div4"></div>

</body>
</html>

profile
개발자

0개의 댓글