aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/css/inline-size/index.html
blob: 065b30334da30f728697626eed560ea8911110d8 (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
---
title: inline-size
slug: Web/CSS/inline-size
translation_of: Web/CSS/inline-size
---
<div>{{CSSRef}}</div>

<p>Свойство <a href="/en-US/docs/Web/CSS" title="CSS">CSS</a> <strong><code>inline-size</code></strong> определяет горизонтальные или вертикальные размеры блока в зависимости от режима написания (writing mode). Оно соответствует свойствам {{cssxref("width")}} и {{cssxref("height")}} и зависит от свойства {{cssxref("writing-mode")}}.</p>

<div>{{EmbedInteractiveExample("pages/css/inline-size.html")}}</div>



<h2 id="Syntax">Syntax</h2>

<pre class="brush:css no-line-numbers notranslate">/* &lt;length&gt; values */
inline-size: 300px;
inline-size: 25em;

/* &lt;percentage&gt; values */
inline-size: 75%;

/* Keyword values */
inline-size: max-content;
inline-size: min-content;
inline-size: fit-content(20em);
inline-size: auto;

/* Global values */
inline-size: inherit;
inline-size: initial;
inline-size: unset;
</pre>

<p>Если режим написания (writing mode) — вертикальный, значение <code>inline-size</code> относится к высоте элемента; в противном случае, оно относиться к ширине элемента. Связанное свойство — {{cssxref("block-size")}}, которое определяет другие размеры элемента.</p>

<h3 id="Значения">Значения</h3>

<p>Свойство <code>inline-size</code> принимает те же значения, что и свойства {{cssxref("width")}} и {{cssxref("height")}}.</p>

<h2 id="Formal_definition">Formal definition</h2>

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

<h2 id="Formal_syntax">Formal syntax</h2>

{{csssyntax}}

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

<h3 id="Setting_inline_size_in_pixels">Setting inline size in pixels</h3>

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

<pre class="brush: html notranslate">&lt;p class="exampleText"&gt;Example text&lt;/p&gt;
</pre>

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

<pre class="brush: css notranslate">.exampleText {
  writing-mode: vertical-rl;
  background-color: yellow;
  inline-size: 110px;
}</pre>

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

<p>{{EmbedLiveSample("Setting_inline_size_in_pixels")}}</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("CSS Logical Properties", "#propdef-inline-size", "inline-size")}}</td>
   <td>{{Spec2("CSS Logical Properties")}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

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



<p>{{Compat("css.properties.inline-size")}}</p>

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

<ul>
 <li>The mapped physical properties: {{cssxref("width")}} and {{cssxref("height")}}</li>
 <li>{{cssxref("writing-mode")}}</li>
</ul>