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
148
|
---
title: right
slug: Web/CSS/right
tags:
- CSS
- CSS Property
- Własność CSS
- border
translation_of: Web/CSS/right
---
<div>{{CSSRef}}</div>
<p>Własność <a href="/en-US/docs/Web/CSS" title="CSS">CSS</a> <code>right</code> pełni ważną rolę w określaniu pionowej pozycji pozycjonowanego elementu. Nie ma wpływu na elementy z nieokreślonym położeniem.</p>
<p>{{EmbedInteractiveExample("pages/css/right.html")}}</p>
<p>Efekt <code>right</code> jest zależny od pozycji elementu (czyli od własności <code>position </code>elementu).</p>
<ul>
<li>When <code>position</code> is set to <code>absolute</code> or <code>fixed</code>, the <code>right</code> property specifies the distance between the element's right edge and the right edge of its containing block.</li>
<li>When <code>position</code> is set to <code>relative</code>, the <code>right</code> property specifies the distance the element's right edge is moved to the left from its normal position.</li>
<li>When <code>position</code> is set to <code>sticky</code>, the <code>right</code> property behaves like its <code>position</code> is <code>relative</code> when the element is inside the viewport, and like its <code>position</code> is <code>fixed</code> when it is outside.</li>
<li>When <code>position</code> is set to <code>static</code>, the <code>right</code> property has <em>no effect</em>.</li>
</ul>
<p>When both {{cssxref("left")}} and <code>right</code> are defined, and the element cannot stretch to satisfy both, the position of the element is<em> overspecified</em>. When this is the case, the <code>left</code> value has precedence when the container is left-to-right; the <code>right</code> value has precedence when the container is right-to-left.</p>
<h2 id="Syntax" name="Syntax">Składnia</h2>
<pre class="brush:css no-line-numbers">/* Wartość liczbowa (długość) */
right: 3px;
right: 2.4em;
/* Wartość procentowa */
right: 10%;
/* Wartość kluczowa */
right: auto;
/* Wartości globalne */
right: inherit;
right: initial;
right: unset;
</pre>
<h3 id="Values" name="Values">Values</h3>
<dl>
<dt>{{cssxref("<length>")}}</dt>
<dd>Negatywna, pozytywna lub o wartości <code>null </code>długość, która dla:</dd>
<dd>
<ul>
<li>elementów z <code>position: absolute</code>, określa odległość do prawej krawędzi rodzica</li>
<li>elementów z <code>position: relative</code>, określa czy element jest przeniesiony do lewej krawędzi jej normalnej (domyślnej) pozycji</li>
</ul>
</dd>
<dt>{{cssxref("<percentage>")}}</dt>
<dd>Wartość procentowa określa procentową odległość w stosunku do szerokości rodzica. </dd>
<dt></dt>
<dt><code>auto</code></dt>
<dd>Specifies that:
<ul>
<li>for <em>absolutely positioned elements</em>, the position of the element is based on the {{Cssxref("left")}} property, while <code>width: auto</code> is treated as a width based on the content; or if <code>left</code> is also <code>auto</code>, the element is positioned where it should horizontally be positioned if it were a static element.</li>
<li>for <em>relatively positioned elements</em>, the distance of the element from its normal position is based on the {{Cssxref("left")}} property; or if <code>left</code> is also <code>auto</code>, the element is not moved horizontally at all.</li>
</ul>
</dd>
<dt><code>inherit</code></dt>
<dd>Specifies that the value is the same as the computed value from its parent element (which might not be its containing block). This computed value is then handled as if it were a {{cssxref("<length>")}}, {{cssxref("<percentage>")}}, or the <code>auto</code> keyword.</dd>
</dl>
<h3 id="Formal_syntax">Formal syntax</h3>
{{csssyntax}}
<h2 id="Examples" name="Examples">Przykłady</h2>
<pre class="brush: css; highlight:[16]">#example_3 {
width: 100px;
height: 100px;
background-color: #FFC7E4;
position: relative;
top: 20px;
left: 20px;
}
#example_4 {
width: 100px;
height: 100px;
background-color: #FFD7C2;
position: absolute;
bottom: 10px;
right: 20px;
}</pre>
<pre class="brush: html"><div id="example_3">Example 3</div>
<div id="example_4">Example 4</div>
</pre>
<p>{{ EmbedLiveSample('Examples', 500, 220) }}</p>
<h2 id="Specifications" name="Specifications">Specyfikacja</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specyfikacja</th>
<th scope="col">Status</th>
<th scope="col">Komentarz</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('CSS3 Transitions', '#animatable-css', 'right')}}</td>
<td>{{Spec2('CSS3 Transitions')}}</td>
<td>Definiuje <code>right </code>jako animatable (możliwy do animowania)</td>
</tr>
<tr>
<td>{{SpecName('CSS3 Positioning', '#propdef-right', 'right')}}</td>
<td>{{Spec2('CSS3 Positioning')}}</td>
<td>
<p>Określa zachowanie dla <code>sticky position</code>.</p>
</td>
</tr>
<tr>
<td>{{SpecName('CSS2.1', 'visuren.html#propdef-right', 'right')}}</td>
<td>{{Spec2('CSS2.1')}}</td>
<td>
<p>Initial definition.</p>
</td>
</tr>
</tbody>
</table>
<p>{{cssinfo}}</p>
<h2 id="Browser_compatibility" name="Browser_compatibility">Zgodność z przeglądarkami</h2>
<p>{{Compat("css.properties.right")}}</p>
<h2 id="Zobacz_jeszcze">Zobacz jeszcze</h2>
<ul>
<li>{{cssxref("position")}}, {{cssxref("left")}}, {{cssxref("top")}}, {{cssxref("bottom")}}</li>
</ul>
|