<!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>
.container {
margin: 100px;
}
.box {
width: 100px;
height: 100px;
background: orange;
border: 4px dashed red;
text-align: center;
line-height: 100px;
/* 텍스트 y축 중앙정렬 */
}
.box:nth-child(2) {
position: absolute;
left: 60px;
top: 60px;
}
</style>
</head>
<body>
<div class="container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
</div>
</body>
</html>
'CSS입문' 카테고리의 다른 글
CSS_position(실습1)_22.04.12(Tue) (0) | 2022.04.12 |
---|---|
CSS_position(absolute-02)_22.04.12(Tue) (0) | 2022.04.12 |
CSS_position(relative)_22.04.12(Tue) (0) | 2022.04.12 |
CSS_position_22.04.12(Tue) (0) | 2022.04.12 |
CSS_박스띄우기(실습3)_22.04.12(Tue) (0) | 2022.04.12 |