aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/css/border-top/index.html
blob: 9f4bcebe8e3232fa46cfbdd3268263be63c30222 (plain)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
title: border-top
slug: Web/CSS/border-top
tags:
  - CSS
  - CSS Borders
  - CSS Property
  - Reference
  - 테두리
translation_of: Web/CSS/border-top
---
<div>{{CSSRef}}</div>

<p><span class="seoSummary"><strong><code>border-top</code></strong> <a href="/ko/docs/Web/CSS">CSS</a> <a href="/ko/docs/Web/CSS/Shorthand_properties">단축 속성</a>은 요소의 위쪽 테두리를 설정합니다.</span> {{cssxref("border-top-width")}}, {{cssxref("border-top-style")}}, {{cssxref("border-top-color")}}의 값을 지정합니다.</p>

<div>{{EmbedInteractiveExample("pages/css/border-top.html")}}</div>



<p>다른 단축 속성과 마찬가지로, <code>border-top</code>는 자신이 포함한 모든 값을 지정하며 사용자가 명시하지 않은 속성도 기본값으로 설정합니다. 즉, 아래 두 코드는 사실 동일합니다.</p>

<pre class="brush: css">border-top-style: dotted;
border-top: thick green;
</pre>

<pre class="brush: css">border-top-style: dotted;
border-top: none thick green;
</pre>

<p>따라서 <code>border-top</code>보다 먼저 지정한 {{cssxref("border-top-style")}}의 값은 무시됩니다. {{cssxref("border-top-style")}}의 기본값은 <code>none</code>이므로, <code>border-style</code>을 명시하지 않으면 테두리를 만들지 않습니다.</p>

<h2 id="구문">구문</h2>

<pre class="brush: css no-line-numbers">border-top: 1px;
border-top: 2px dotted;
border-top: medium dashed green;
</pre>

<p><code>border-top</code>은 한 개에서 세 개의 값을 사용해 지정할 수 있고, 순서는 상관하지 않습니다.</p>

<h3 id="값"></h3>

<dl>
 <dt><code>&lt;br-width&gt;</code></dt>
 <dd>{{cssxref("border-top-width")}}.</dd>
 <dt><code>&lt;br-style&gt;</code></dt>
 <dd>{{cssxref("border-top-style")}}.</dd>
 <dt>{{cssxref("&lt;color&gt;")}}</dt>
 <dd>{{cssxref("border-top-color")}}.</dd>
</dl>

<h3 id="형식_구문">형식 구문</h3>

{{csssyntax}}

<h2 id="예제">예제</h2>

<pre class="brush: html">&lt;div&gt;
  위쪽 테두리를 가진 요소입니다.
&lt;/div&gt;</pre>

<pre class="brush: css">div {
  border-top: 4px dashed blue;
  background-color: gold;
  height: 100px;
  width: 100px;
  font-weight: bold;
  text-align: center;
}
</pre>

<p>{{EmbedLiveSample('예제')}}</p>

<h2 id="Specifications" name="Specifications">명세</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Backgrounds', '#border-top', 'border-top')}}</td>
   <td>{{Spec2('CSS3 Backgrounds')}}</td>
   <td>No direct changes, though the modification of values for the {{cssxref("border-top-color")}} do apply to it.</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS2.1', 'box.html#propdef-border-top', 'border-top')}}</td>
   <td>{{Spec2('CSS2.1')}}</td>
   <td>No significant changes.</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS1', '#border-top', 'border-top')}}</td>
   <td>{{Spec2('CSS1')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<div>{{cssinfo}}</div>

<h2 id="Browser_compatibility" name="Browser_compatibility">브라우저 호환성</h2>

<div class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>

<p>{{Compat("css.properties.border-top")}}</p>