mozilla

Revision 289354 of <ratio>

  • Revision slug: CSS/ratio
  • Revision title: ratio
  • Revision id: 289354
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

Summary

The <ratio> CSS data type, used for describing aspect ratios in media queries, denotes the proportion between two unitless values. It is a strictly positive {{ xref_cssinteger() }} followed by a slash ('/', Unicode U+002F SOLIDUS) and a second strictly positive {{ xref_cssinteger() }}. There may be spaces before and after the solidus.

Examples

  Ratio Usage
Ratio4_3.png 4/3 Traditional TV format in the 20th century.
Ratio16_9.png 16/9 Modern, 'widescreen', TV format.
Ratio1_1.85.png 185/100 = 91/50
(non-integer dividends and divisors are not allowed)
The most common movie format since the 1960s.
Ratio1_2.39.png

239/100
(non-integer dividends and divisors are not allowed)

The 'widescreen', anamorphic, movie format.

Specifications

Specification Status Comment
CSS Media Queries Level 3 {{ Spec2('CSS3 Media Queries') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support <4 3.5 (1.9.1) 9 9.5 1.0 (?)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support yes yes ? yes yes

See also

{{ languages( { "ja": "ja/CSS/resolution" } ) }}

 

Revision Source

<h2 id="Summary">Summary</h2>
<p>The <code>&lt;ratio&gt; </code><a href="/en/CSS" title="CSS">CSS</a> data type, used for describing aspect ratios in <a class="internal" href="/En/CSS/Media_queries" title="en/CSS/Media queries">media queries</a>, denotes the proportion between two unitless values. It is a strictly positive {{ xref_cssinteger() }} followed by a slash ('/', Unicode<code> U+002F SOLIDUS</code>) and a second strictly positive {{ xref_cssinteger() }}. There may be spaces before and after the solidus.</p>
<h2 id="Examples" name="Examples">Examples</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col"> </th>
      <th scope="col">Ratio</th>
      <th scope="col">Usage</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><img alt="Ratio4_3.png" class="internal default" src="/@api/deki/files/5714/=Ratio4_3.png"></td>
      <td><code>4/3</code></td>
      <td>Traditional TV format in the 20<sup>th</sup> century.</td>
    </tr>
    <tr>
      <td><img alt="Ratio16_9.png" src="/@api/deki/files/5711/=Ratio16_9.png"></td>
      <td><code>16/9</code></td>
      <td>Modern, 'widescreen', TV format.</td>
    </tr>
    <tr>
      <td><img alt="Ratio1_1.85.png" src="/@api/deki/files/5712/=Ratio1_1.85.png"></td>
      <td><code>185/100</code> = <code>91/50</code><br>
        <em>(non-integer dividends and divisors are not allowed)</em></td>
      <td>The most common movie format since the 1960s.</td>
    </tr>
    <tr>
      <td><img alt="Ratio1_2.39.png" src="/@api/deki/files/5713/=Ratio1_2.39.png"></td>
      <td>
        <p><code>239/100</code><br>
          <em>(non-integer dividends and divisors are not allowed)</em></p>
      </td>
      <td>The 'widescreen', anamorphic, movie format.</td>
    </tr>
  </tbody>
</table>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr style="background-color: rgb(255, 204, 255);">
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="external" href="http://www.w3.org/TR/css3-mediaqueries/#values" title="http://www.w3.org/TR/css3-mediaqueries/#values">CSS Media Queries Level 3</a>
      </td>
      <td>{{ Spec2('CSS3 Media Queries') }}</td>
      <td> </td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari (WebKit)</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>&lt;4</td>
        <td>3.5 (1.9.1)</td>
        <td>9</td>
        <td>9.5</td>
        <td>1.0 (?)</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>yes</td>
        <td>yes</td>
        <td>?</td>
        <td>yes</td>
        <td>yes</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
  <li><a class="internal" href="/En/CSS/Media_queries" title="en/CSS/Media queries">CSS Media Queries</a></li>
  <li><a href="/en/CSS_Reference" title="CSS Reference">CSS Reference</a> Index</li>
  <li>CSS Data Types : {{ CSSDataTypes() }}</li>
</ul>
<div class="noinclude">
  <p>{{ languages( { "ja": "ja/CSS/resolution" } ) }}</p>
</div>
<p> </p>
Revert to this revision