-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinset-inline.html
More file actions
40 lines (39 loc) · 1.55 KB
/
Copy pathinset-inline.html
File metadata and controls
40 lines (39 loc) · 1.55 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
40
<!DOCTYPE html>
<!-- HTML5 문서 선언 -->
<html lang="ko">
<head>
<meta charset="utf-8">
<title>inset-inline - 인라인 방향(수평 쓰기 모드에서 left/right)의 논리적 오프셋을 설정하는 단축 속성입니다</title>
<!--
[레이아웃] inset-inline
설명: 인라인 방향(수평 쓰기 모드에서 left/right)의 논리적 오프셋을 설정하는 단축 속성입니다
구문: inset-inline: auto | <length> | <percentage>
팁: 논리적 속성으로, writing-mode와 direction에 따라 실제 적용되는 물리적 방향이 달라집니다. 다국어 지원에 유용합니다.
-->
<style>
/* .parent: absolute 자손의 기준점 */
.parent {
position: relative; /* 포함 블록 역할 */
background: #f1f5f9; /* 회색 배경 */
height: 80px; /* 고정 높이 */
}
/* .box: 인라인 양쪽 오프셋이 동일한 박스 */
.box {
position: absolute; /* 절대 위치 */
top: 10px; /* 위에서 10px */
inset-inline: 20px; /* 인라인 시작/끝(수평 쓰기에선 left/right) 양쪽 20px */
background: #3b82f6; /* 파란 배경 */
color: white; /* 흰 글자 */
padding: 8px 16px; /* 안쪽 여백 */
border-radius: 4px; /* 모서리 둥글게 */
text-align: center; /* 가운데 정렬 */
}
</style>
</head>
<body>
<!-- 인라인 단축 속성으로 좌우 모두 지정 -->
<div class="parent">
<div class="box">inset-inline: 20px</div>
</div>
</body>
</html>