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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
---
title: dir
slug: Web/HTML/Global_attributes/dir
tags:
- BiDi
- Global attributes
- HTML
- Reference
translation_of: Web/HTML/Global_attributes/dir
---
<div>{{HTMLSidebar("Global_attributes")}}</div>
<p><code><strong>dir</strong></code> <a href="/ko/docs/Web/HTML/Global_attributes">전역 특성</a>은 요소의 쓰기 방향을 나타내는 열거형 특성입니다.</p>
<div>{{EmbedInteractiveExample("pages/tabbed/attribute-dir.html","tabbed-standard")}}</div>
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples </a> and send us a pull request.</p>
<p>가능한 값은 다음과 같습니다.</p>
<ul>
<li><code>ltr</code>은 왼쪽에서 오른쪽을 뜻하며, 좌횡서 언어인 한국어나 영어에 사용합니다.</li>
<li><code>rtl</code>은 오른쪽에서 왼쪽을 뜻하며, 우횡서 언어인 아랍어 등을 사용합니다.</li>
<li><code>auto</code>는 {{glossary("user agent", "사용자 에이전트")}}가 결정합니다. 사용자 에이전트는 기본적인 알고리즘을 사용해 요소 내부의 문자를 분석한 후, 명확한 방향성을 가진 문자가 존재하는 경우 전체 요소에 해당 방향성을 적용합니다.</li>
</ul>
<div class="note">
<p><strong>참고:</strong> <code>dir</code> 특성은{{HTMLElement("bdo")}} 요소에 필수로 지정해야 하며, 다른 뜻을 가집니다.</p>
<ul>
<li>
<p>{{ HTMLElement("bdi") }} 요소는 <code>dir</code> 특성을 상속하지 않으며, 지정하지 않은 경우 <code>auto</code>를 기본값으로 사용합니다.</p>
</li>
<li>
<p>{{ cssxref("direction") }}과 {{ cssxref("unicode-bidi") }}를 지원하며 CSS를 활성화한 경우, 특성 값은 무시하고 CSS 값을 대신 사용합니다.</p>
</li>
<li>
<p>글자의 쓰기 방향은 외형이 아니라 그 의미에 관여하므로, 웹 개발자로서 되도록 CSS 속성 대신 <code>dir</code> 특성을 사용하세요. 관련 속성을 지원하지 않거나, CSS를 비활성화한 브라우저에서도 텍스트가 올바른 방향으로 나타납니다.</p>
</li>
<li>
<p>데이터베이스에 저장된 사용자 입력 값처럼 방향성을 알 수 없는 데이터에는 <code>auto</code> 값을 사용해야 합니다.</p>
</li>
</ul>
</div>
<h2 id="명세">명세</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG', "dom.html#the-dir-attribute", "dir")}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>No change from latest snapshot, {{SpecName('HTML5.1')}}</td>
</tr>
<tr>
<td>{{SpecName('HTML5.1', "dom.html#the-dir-attribute", "dir")}}</td>
<td>{{Spec2('HTML5.1')}}</td>
<td>Snapshot of {{SpecName('HTML WHATWG')}}, no change from {{SpecName('HTML5 W3C')}}</td>
</tr>
<tr>
<td>{{SpecName('HTML5 W3C', "dom.html#the-dir-attribute", "dir")}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td>Snapshot of {{SpecName('HTML WHATWG')}}, from {{SpecName('HTML4.01')}} it added the <code>auto</code> value, and is now a true global attribute.</td>
</tr>
<tr>
<td>{{SpecName('HTML4.01', "dirlang.html#h-8.2", "dir")}}</td>
<td>{{Spec2('HTML4.01')}}</td>
<td>Supported on all elements but {{HTMLElement("applet")}}, {{HTMLElement("base")}}, {{HTMLElement("basefont")}}, {{HTMLElement("bdo")}}, {{HTMLElement("br")}}, {{HTMLElement("frame")}}, {{HTMLElement("frameset")}}, {{HTMLElement("iframe")}}, {{HTMLElement("param")}}, and {{HTMLElement("script")}}.</td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{Compat("html.global_attributes.dir")}}</p>
<h2 id="같이_보기">같이 보기</h2>
<ul>
<li>모든 <a href="/ko/docs/Web/HTML/Global_attributes">전역 특성</a>.</li>
<li>이 특성을 나타내는 {{domxref("HTMLElement.dir")}}.</li>
</ul>
|