[HTML/CSS] 뷰포트 중앙정렬하기

2024. 1. 3.공부/HTML,CSS

728x90
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>중앙정렬</title>
    <style>
        .circle {
            position: absolute;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: black;
            transform: translate(-50%, -50%);
            top: 50%;
            left: 50%;
        }
    </style>
</head>

<body>
    <div class="circle">
    </div>
</body>

</html>