diff options
Diffstat (limited to 'files/zh-cn/conflicting/web/css/@viewport_7861ca3461a359b150d44f2c8d74e53a/index.html')
-rw-r--r-- | files/zh-cn/conflicting/web/css/@viewport_7861ca3461a359b150d44f2c8d74e53a/index.html | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/files/zh-cn/conflicting/web/css/@viewport_7861ca3461a359b150d44f2c8d74e53a/index.html b/files/zh-cn/conflicting/web/css/@viewport_7861ca3461a359b150d44f2c8d74e53a/index.html new file mode 100644 index 0000000000..11519cee6e --- /dev/null +++ b/files/zh-cn/conflicting/web/css/@viewport_7861ca3461a359b150d44f2c8d74e53a/index.html @@ -0,0 +1,110 @@ +--- +title: orientation +slug: Web/CSS/@viewport/orientation +tags: + - CSS + - CSS Description +translation_of: Web/CSS/@viewport +translation_of_original: Web/CSS/@viewport/orientation +--- +<div>{{CSSRef}}</div> + +<h2 id="摘要">摘要</h2> + +<p>此 <strong><code>orientation</code></strong> <a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS</a> 描述符控制由{{cssxref("@viewport")}}定义文档的方向。</p> + +<p><span style="line-height: 1.5;">通过设备的倾斜摆动情况来决定文档显示的方向,作者可以通过设置这个描述符来抑制方向的变化{{cssinfo}}</span></p> + +<h2 id="语法">语法</h2> + +<pre class="brush:css">/* Keyword values */ +orientation: auto; +orientation: portrait;/*锁定为纵向*/ +orientation: landscape;/* 锁定为横向*/ +</pre> + +<h3 id="取值">取值</h3> + +<dl> + <dt><code>auto</code></dt> + <dd>用户代理将文档的方向设置为自动,通常基于设备的定位由加速度传感器 (如果设备具有这种硬件传感器),但是用户控制,OS 级别的"锁方向"往往会优先于加速度传感器的设置。</dd> + <dt><code>portrait</code></dt> + <dd>文档被锁定为纵向。</dd> + <dt><code>landscape</code></dt> + <dd>文档被锁定为横向。</dd> +</dl> + +<h3 id="标准语法">标准语法</h3> + +<pre class="syntaxbox">{{csssyntax}}</pre> + +<h2 id="规范">规范</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('CSS3 Device', '#the-lsquoorientationrsquo-descriptor', '"orientation" descriptor')}}</td> + <td>{{Spec2('CSS3 Device')}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</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</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>10 {{property_prefix("-ms")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatUnknown}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Chrome for Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>8 {{property_prefix("-o")}}</td> + <td>{{CompatUnknown}}</td> + </tr> + </tbody> +</table> +</div> |