aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/css/border-width/index.html
blob: 2452c77fc323faef91cc128cfd3adb893baedd0c (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
---
title: border-width
slug: Web/CSS/border-width
translation_of: Web/CSS/border-width
---
<div>{{CSSRef}}</div>

<h2 id="Summary">Summary</h2>

<p>CSS-свойство {{cssxref("border-width")}}<span style="line-height: 1.5;"> определяет ширину рамки элемента. Но обычно её задают не отдельно, а в составе свойства {{cssxref("border")}}.</span></p>

<p>{{cssinfo}}</p>

<h2 id="Синтаксис">Синтаксис</h2>

<pre class="twopartsyntaxbox"><a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Общий синтаксис</a>: {{csssyntax("border-width")}}
</pre>

<pre>border-width: <em>ширина</em> <em>                 /* Одно значение */</em>
border-width: <em>вертикальная горизонтальная</em> <em>   /* Два значения */</em>
border-width: <em>верх</em> <em>горизонтальная </em><em>основание</em><em> </em><em>   /* Три значения */</em>
border-width: <em>верх</em> <em>право</em> <em>основание</em> <em>лево </em><em> /* Четыре значения */</em>

border-width: inherit /* Родительское значение */
</pre>

<h3 id="Values">Values</h3>

<dl>
 <dt><code>&lt;br-width&gt;</code></dt>
 <dd>Is either a non-negative explicit {{cssxref("&lt;length&gt;")}} value or a keyword denoting the thickness of the bottom border. The keyword must be one of the following values:
 <table class="standard-table">
  <tbody>
   <tr>
    <td style="vertical-align: middle;"><code>thin</code></td>
    <td style="vertical-align: middle;">
     <div style="margin: 0.5em; width: 3em; height: 3em; border-style: solid; border-width: thin; background-color: palegreen;"></div>
    </td>
    <td style="vertical-align: middle;">A thin border</td>
   </tr>
   <tr>
    <td style="vertical-align: middle;"><code>medium</code></td>
    <td style="vertical-align: middle;">
     <div style="margin: 0.5em; width: 3em; height: 3em; border-style: solid; border-width: medium; background-color: palegreen;"></div>
    </td>
    <td style="vertical-align: middle;">A medium border</td>
   </tr>
   <tr>
    <td style="vertical-align: middle;"><code>thick</code></td>
    <td style="vertical-align: middle;">
     <div style="margin: 0.5em; width: 3em; height: 3em; border-style: solid; border-width: thick; background-color: palegreen;"></div>
    </td>
    <td style="vertical-align: middle;">A thick border</td>
   </tr>
  </tbody>
 </table>
 The specification doesn't precisely define the thickness of each of the keywords, which is therefore implementation specific. Nevertheless, it requests that the thickness does follow the <code>thin ≤ medium ≤ thick</code> inequality and that the values are constant on a single document.</dd>
</dl>

<p><code>inherit</code></p>

<dl>
 <dd>Is a keyword indicating that all four values are inherited from their parent's element calculated value.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<h3 id="A_mix_of_values_and_lengths">A mix of values and lengths</h3>

<h4 id="HTML">HTML</h4>

<pre class="brush: html">&lt;p id="sval"&gt;
    one value: 6px wide border on all 4 sides&lt;/p&gt;
&lt;p id="bival"&gt;
    two different values: 2px wide top and bottom border, 10px wide right and left border&lt;/p&gt;
&lt;p id="treval"&gt;
    three different values: 0.3em top, 9px bottom, and zero width right and left&lt;/p&gt;
&lt;p id="fourval"&gt;
    four different values: "thin" top, "medium" right, "thick" bottom, and 1em right&lt;/p&gt;</pre>

<h4 id="CSS">CSS</h4>

<pre class="brush: css">#sval {
    border: ridge #ccc;
    border-width: 6px;
}
#bival {
    border: solid red;
    border-width: 2px 10px;
}
#treval {
    border: dotted orange;
    border-width: 0.3em 0 9px;
}
#fourval {
    border: solid lightgreen;
    border-width: thin medium thick 1em;
}
p {
    width: auto;
    margin: 0.25em;
    padding: 0.25em;
}</pre>

<h4 id="Result">Result</h4>

<p>{{ EmbedLiveSample('A_mix_of_values_and_lengths', 300, 180) }}</p>

<h2 id="Specifications">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', '#the-border-width', 'border-width')}}</td>
   <td>{{Spec2('CSS3 Backgrounds')}}</td>
   <td>No direct change, the {{cssxref("&lt;length&gt;")}} CSS data type extension has an effect on this property.</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS2.1', 'box.html#border-width-properties', 'border-width')}}</td>
   <td>{{Spec2('CSS2.1')}}</td>
   <td>Added the constraint that values' meaning must be constant inside a document.</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS1', '#border-width', 'border-width')}}</td>
   <td>{{Spec2('CSS1')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

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

<h2 id="See_also">See also</h2>

<ul>
 <li>The border-related shorthand properties: {{Cssxref("border")}}, {{Cssxref("border-style")}}, {{Cssxref("border-color")}}</li>
 <li>The border-width-related properties: {{Cssxref("border-bottom-width")}}, {{Cssxref("border-left-width")}}, {{Cssxref("border-right-width")}}, {{Cssxref("border-top-width")}}</li>
</ul>