aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/inline-size
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/inline-size
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/css/inline-size')
-rw-r--r--files/zh-cn/web/css/inline-size/index.html100
1 files changed, 100 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/inline-size/index.html b/files/zh-cn/web/css/inline-size/index.html
new file mode 100644
index 0000000000..ca87a6528f
--- /dev/null
+++ b/files/zh-cn/web/css/inline-size/index.html
@@ -0,0 +1,100 @@
+---
+title: inline-size
+slug: Web/CSS/inline-size
+translation_of: Web/CSS/inline-size
+---
+<div>{{CSSRef}}</div>
+
+
+
+<p><strong><code>inline-size</code></strong> <a href="/en-US/docs/Web/CSS" title="CSS">CSS</a> 属性影响一个元素的{{cssxref("width")}} 或 {{cssxref("height")}},以改变一个元素的盒模型的水平或垂直大小(是width还是height取决于该元素的{{cssxref("writing-mode")}})。</p>
+
+<div>{{EmbedInteractiveExample("pages/css/inline-size.html")}}</div>
+
+
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush:css no-line-numbers">/* &lt;length&gt; values */
+inline-size: 300px;
+inline-size: 25em;
+
+/* &lt;percentage&gt; values */
+inline-size: 75%;
+
+/* Keyword values */
+inline-size: max-content;
+inline-size: min-content;
+inline-size: fit-content(20em);
+inline-size: auto;
+
+/* Global values */
+inline-size: inherit;
+inline-size: initial;
+inline-size: unset;
+</pre>
+
+
+
+<p>如果元素的writing-mode是垂直方向的它会影响height,否则默认是影响width。</p>
+
+<p>有一个与inline-size 属性有关的{{cssxref("block-size")}},它定义了元素的其他尺寸。</p>
+
+<p>{{cssinfo}}</p>
+
+<h3 id="值">值</h3>
+
+<p><code>inline-size</code>属性的可选值与{{cssxref("width")}}和{{cssxref("height")}}的可选值一样。</p>
+
+<h3 id="正式语法">正式语法</h3>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;p class="exampleText"&gt;Example text&lt;/p&gt;
+</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css">.exampleText {
+ writing-mode: vertical-rl;
+ background-color: yellow;
+ inline-size: 110px;
+}</pre>
+
+<p>{{EmbedLiveSample("Example")}}</p>
+
+<h2 id="规范">规范</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("CSS Logical Properties", "#propdef-inline-size", "inline-size")}}</td>
+ <td>{{Spec2("CSS Logical Properties")}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("css.properties.inline-size")}}</p>
+
+<h2 id="参阅">参阅</h2>
+
+<ul>
+ <li>The mapped physical properties: {{cssxref("width")}} and {{cssxref("height")}}</li>
+ <li>{{cssxref("writing-mode")}}</li>
+</ul>