-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbottom.html
More file actions
39 lines (38 loc) · 1.34 KB
/
Copy pathbottom.html
File metadata and controls
39 lines (38 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<!-- HTML5 문서 선언 -->
<html lang="ko">
<head>
<meta charset="utf-8">
<title>bottom - 위치가 지정된 요소의 아래쪽 오프셋을 설정합니다</title>
<!--
[레이아웃] bottom
설명: 위치가 지정된 요소의 아래쪽 오프셋을 설정합니다
구문: bottom: auto | <length> | <percentage>
팁: top과 bottom이 동시에 설정되고 height가 auto이면, absolute/fixed 요소는 두 값 사이의 공간을 채웁니다.
-->
<style>
/* .parent: 자식 absolute의 기준점 */
.parent {
position: relative; /* absolute 자손의 포함 블록 */
background: #f1f5f9; /* 회색 배경 */
height: 80px; /* 고정 높이 */
}
/* .box: 아래에서 10px 떨어진 절대 위치 박스 */
.box {
position: absolute; /* 절대 위치 */
bottom: 10px; /* 아래에서 10px */
left: 10px; /* 왼쪽에서 10px */
background: #3b82f6; /* 파란 배경 */
color: white; /* 흰 글자 */
padding: 8px 16px; /* 안쪽 여백 */
border-radius: 4px; /* 모서리 둥글게 */
}
</style>
</head>
<body>
<!-- bottom 오프셋 시연 -->
<div class="parent">
<div class="box">bottom: 10px</div> <!-- 아래에서 10px 떨어진 박스 -->
</div>
</body>
</html>