From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/image-orientation/index.html | 89 ++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 files/zh-cn/web/css/image-orientation/index.html (limited to 'files/zh-cn/web/css/image-orientation/index.html') diff --git a/files/zh-cn/web/css/image-orientation/index.html b/files/zh-cn/web/css/image-orientation/index.html new file mode 100644 index 0000000000..42de520c23 --- /dev/null +++ b/files/zh-cn/web/css/image-orientation/index.html @@ -0,0 +1,89 @@ +--- +title: image-orientation +slug: Web/CSS/image-orientation +translation_of: Web/CSS/image-orientation +--- +
{{CSSRef}}
+ +
{{SeeCompatTable}}
+ +

概述

+ +

CSS 属性 image-orientation 用来修正某些图片的预设方向.

+ +
+

注意:

+ + +
+ +

{{cssinfo}}

+ +

语法

+ +
语法形式: {{csssyntax("image-orientation")}}
+
+ +
image-orientation: 0deg
+image-orientation: 6.4deg     /* 非 90 度的整数倍, 所以会被四舍五入到 0 度 */
+image-orientation: -90deg     /* 相当于 270deg */
+image-orientation: from-image /* 使用图片的 EXIF 数据 */
+image-orientation: 90deg flip /* 旋转 90deg, 再水平翻转 */
+image-orientation: flip       /* 不旋转, 只进行水平翻转 */
+
+image-orientation: inherit
+
+ +

属性值

+ +
+
from-image
+
根据图片的 EXIF 数据来旋转图片, EXIF 中有一个控制图片旋转度的属性.
+
<angle>
+
图片旋转值 {{cssxref("<angle>")}} , 会被自动四舍五入到 90deg (0.25turn) 的整数倍.
+
flip
+
对图片进行水平翻转, 先进行第二个参数执行的旋转, 再进行此次翻转.
+
+ +

示例

+ +

规范

+ + + + + + + + + + + + + + + + + + + + + +
规范名称规范状态备注
{{SpecName('CSS4 Images', '#image-orientation', 'image-orientation')}}{{Spec2('CSS4 Images')}}增加了对 from-imageflip 关键字的支持.
{{SpecName('CSS3 Images', '#image-orientation', 'image-orientation')}}{{Spec2('CSS3 Images')}} 
+ +

浏览器兼容性

+ +
+ + +

{{Compat("css.properties.image-orientation")}}

+
+ +

相关链接

+ + -- cgit v1.2.3-54-g00ecf