mozilla

Revision 300047 of image-orientation

  • Revision slug: CSS/image-orientation
  • Revision title: image-orientation
  • Revision id: 300047
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

{{ SeeCompatTable() }}

Summary

The image-orientation CSS property describes how to correct the default orientation of an image.

Note:

  • This property is not intended to perform arbitrary rotation on an image, but to correct erroneous orientation. That's why it is rounded to the nearest quarter of turn.
  • Similarly this property is not intented to handle the layout -> portrait changing. As image-orientation affects only images, it won't work: the changes must happen at the layout-level
  • In the future CSS Image Values and Replaced Content Module Level 4, it is intended to add a new value, likely from-image, to instruct CSS to take into account EXIF data (which it currently doesn't).
  • {{ Xref_cssinitial() }} 0deg
  • Applies to all elements
  • {{ Xref_cssinherited() }} no
  • Media {{ xref_cssvisual() }}
  • {{ Xref_csscomputed() }} the <angle> value, rounded to the closest 1/4 of turn and normalized (that is positive and module 360deg)
  • {{ Xref_cssanimatable() }} no
  • {{ Xref_csscanonicalorder() }} the unique non-ambiguous order defined by the formal grammar

Syntax

Formal grammar: <angle>
image-orientation: 0deg
image-orientation: 6.4deg   /* Rounded to 0deg */
image-orientation: -90deg   /* Equivalent to 270deg, its normalized computed value */

Values

<angle>
The {{ xref_cssangle() }} of rotation to apply to the image. It is rounded to the nearest 90deg (0.25turn)

Examples

 

Specifications

Specification Status Comment
{{ SpecName('CSS3 Images', '#image-orientation', 'image-orientation') }} {{ Spec2('CSS3 Images') }} Initial specification.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

See also

Revision Source

<p>{{ CSSRef() }}</p>
<p>{{ SeeCompatTable() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>image-orientation</code> <a href="/en-US/docs/CSS">CSS</a> property describes how to correct the default orientation of an image.</p>
<div class="note style-wrap">
  <p><strong>Note:</strong></p>
  <ul>
    <li>This property is not intended to perform arbitrary rotation on an image, but to correct erroneous orientation. That's why it is rounded to the nearest quarter of turn.</li>
    <li>Similarly this property is not intented to handle the layout -&gt; portrait changing. As <code>image-orientation</code> affects only images, it won't work: the changes must happen at the layout-level</li>
    <li>In the future CSS Image Values and Replaced Content Module Level 4, it is intended to add a new value, likely <code>from-image</code>, to instruct CSS to take into account EXIF data (which it currently doesn't).</li>
  </ul>
</div>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}</dfn> <code>0deg</code></li>
  <li><dfn>Applies to</dfn> all elements</li>
  <li><dfn>{{ Xref_cssinherited() }}</dfn> no</li>
  <li><dfn>Media</dfn> {{ xref_cssvisual() }}</li>
  <li><dfn>{{ Xref_csscomputed() }}</dfn> the <code>&lt;angle&gt;</code> value, rounded to the closest 1/4 of turn and normalized (that is positive and module <code>360deg</code>)</li>
  <li><dfn>{{ Xref_cssanimatable() }}</dfn> no</li>
  <li><dfn>{{ Xref_csscanonicalorder() }}</dfn> the unique non-ambiguous order defined by the formal grammar</li>
</ul>
<h2 id="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
Formal grammar: &lt;angle&gt;
</pre>
<pre>
image-orientation: 0deg
image-orientation: 6.4deg   /* Rounded to 0deg */
image-orientation: -90deg   /* Equivalent to 270deg, its normalized computed value */

</pre>
<h3 id="Values">Values</h3>
<dl>
  <dt>
    &lt;angle&gt;</dt>
  <dd>
    The {{ xref_cssangle() }} of rotation to apply to the image. It is rounded to the nearest <code>90deg</code> (<code>0.25turn</code>)</dd>
</dl>
<h2 id="Examples">Examples</h2>
<p>&nbsp;</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 Images', '#image-orientation', 'image-orientation') }}</td>
      <td>{{ Spec2('CSS3 Images') }}</td>
      <td>Initial specification.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_Compatibility" name="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>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</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>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
Revert to this revision