---
title: ry
slug: Web/SVG/Attribute/ry
tags:
  - SVG атрибуты
translation_of: Web/SVG/Attribute/ry
---
<div>{{SVGRef}}</div>

<p>Атрибут <strong><code>ry</code></strong> определяет радиус круга по оси y.</p>

<p>Два элемента используют этот атрибут: <a href="https://developer.mozilla.org/ru/docs/Web/SVG/Element/ellipse" rel="nofollow" title="Документация об этом ещё не написана; пожалуйста, поспособствуйте её написанию!"><code>&lt;ellipse&gt;</code></a> и <a href="https://developer.mozilla.org/ru/docs/Web/SVG/Element/rect" rel="nofollow" title="Документация об этом ещё не написана; пожалуйста, поспособствуйте её написанию!"><code>&lt;rect&gt;</code></a></p>

<div id="topExample">
<div class="hidden">
<pre class="brush: css">html,body,svg { height:100% }</pre>
</div>

<pre class="brush: html">&lt;svg viewBox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"&gt;
  &lt;ellipse cx="50"  cy="50" ry="0"  rx="25" /&gt;
  &lt;ellipse cx="150" cy="50" ry="25" rx="25" /&gt;
  &lt;ellipse cx="250" cy="50" ry="50" rx="25" /&gt;

  &lt;rect x="20"  y="120" width="60" height="60" ry="0"   rx="15"/&gt;
  &lt;rect x="120" y="120" width="60" height="60" ry="15"  rx="15"/&gt;
  &lt;rect x="220" y="120" width="60" height="60" ry="150" rx="15"/&gt;
&lt;/svg&gt;</pre>

<p>{{EmbedLiveSample('topExample', '100%', 200)}}</p>
</div>

<h2 id="ellipse">ellipse</h2>

<p>Для элемента {{SVGElement('ellipse')}}, <code>ry</code> определяет радиус фигуры по оси y. Если значение меньше или равно 0, эллипс не будет нарисован вообще.</p>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="row">Значение</th>
   <td><strong><a href="/docs/Web/SVG/Content_type#Length">&lt;length&gt;</a></strong> | <strong><a href="/docs/Web/SVG/Content_type#Percentage">&lt;percentage&gt;</a></strong> | <code>auto</code></td>
  </tr>
  <tr>
   <th scope="row">Значение по умолчанию</th>
   <td><code>auto</code></td>
  </tr>
  <tr>
   <th scope="row">Анимируемый</th>
   <td>Да</td>
  </tr>
 </tbody>
</table>

<p class="note"><strong>Примечание. </strong>Начиная с <strong>SVG2</strong>, <strong>ry</strong> - <em>свойство геометрии(Geometry Property). </em>Это означает, что атрибут также можно использовать как свойство CSS для эллипсов.</p>

<h2 id="rect">rect</h2>

<p>Для {{SVGElement('rect')}}, <code>ry</code> определяет радиус эллипса по оси x, используется для скругления углов прямоугольника.</p>

<p>Способ интерпретации значения атрибута <code>ry</code> зависит как от атрибута {{SVGAttr("rx")}} , так и от ширины прямоугольника:</p>

<ul>
 <li>Если правильно задано значение для <code>ry</code>, но не для {{SVGAttr("rx")}} (или наоборот), то браузер сочтёт отсутствующее значение равным указанному.</li>
 <li>Если ни <code>ry</code>, ни {{SVGAttr("rx")}} не имеют правильно указанного значения, браузер нарисует прямоугольник с квадратными углами.</li>
 <li>Если <code>ry</code> больше половины ширины прямоугольника, то браузер будет считать значение <code>ry</code> половиной ширины прямоугольника.</li>
</ul>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="row">Значение</th>
   <td><strong><a href="/docs/Web/SVG/Content_type#Length">&lt;length&gt;</a></strong> | <strong><a href="/docs/Web/SVG/Content_type#Percentage">&lt;percentage&gt;</a></strong> | <code>auto</code></td>
  </tr>
  <tr>
   <th scope="row">Значение по умолчанию</th>
   <td><code>auto</code></td>
  </tr>
  <tr>
   <th scope="row">Анимируемый</th>
   <td>Да</td>
  </tr>
 </tbody>
</table>

<p class="note"><strong>Примечание. </strong>Начиная с <strong>SVG2</strong>, <strong>ry</strong> - <em>свойство геометрии(Geometry Property). </em>Это означает, что атрибут также можно использовать как свойство CSS для rect.</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Спецификация</th>
   <th scope="col">Статус</th>
   <th scope="col">Комментарий</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName("SVG2", "geometry.html#RY", "ry")}}</td>
   <td>{{Spec2("SVG2")}}</td>
   <td>Определяется как свойство геометрии</td>
  </tr>
  <tr>
   <td>{{SpecName("SVG1.1", "shapes.html#EllipseElementRYAttribute", "ry")}}</td>
   <td>{{Spec2("SVG1.1")}}</td>
   <td>Начальное определение для <code>&lt;ellipse&gt;</code></td>
  </tr>
  <tr>
   <td>{{SpecName("SVG1.1", "shapes.html#RectElementRYAttribute", "ry")}}</td>
   <td>{{Spec2("SVG1.1")}}</td>
   <td>Начальное определение для <code>&lt;rect&gt;</code></td>
  </tr>
 </tbody>
</table>