210608 UIUX WebDesign CSS 연습_20

ITisIT210·2021년 6월 13일
0

CSS

목록 보기
20/93
post-thumbnail
<!DOCTYPE html>
<html lang="en">
<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>배치</title>
    <style>
        #allBox {
            margin: 0 auto; /* box1, box2를 하나로 묶어서 가운데 배치 */
            width: 1000px;  /* box1, box2의 너비가 500px이므로 500px + 500px */
        }

        #box1 {
            width: 500px;
            height: 500px;
            background-color: #f00;
            float: left;
        }

        #box2 {
            width: 500px;
            height: 500px;
            background-color: #ff0;
            float: right;
        }
    </style>
</head>
<body>
    <div id="allBox">
        <div id="box1">box1</div>
        <div id="box2">box2</div>
    </div>
</body>
</html>
profile
Engineering is the closest thing to magic that exists in the world.

0개의 댓글