mozilla

Revision 356791 of image-orientation

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

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}} {{cssinitial("image-orientation")}}
  • 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 syntax: {{csssyntax("image-orientation")}}
image-orientation: 0deg
image-orientation: 6.4deg   /* Rounded to 0deg */
image-orientation: -90deg   /* Equivalent to 270deg, its normalized computed value */

image-orientation: inherit

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

<div>{{CSSRef}}</div>
<div>{{SeeCompatTable}}</div>
<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> {{cssinitial("image-orientation")}}</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">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("image-orientation")}}
</pre>
<pre>
image-orientation: 0deg
image-orientation: 6.4deg   /* Rounded to 0deg */
image-orientation: -90deg   /* Equivalent to 270deg, its normalized computed value */

image-orientation: inherit
</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>

<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>
<div>{{CompatibilityTable}}</div>
<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