diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/block-size | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/css/block-size')
-rw-r--r-- | files/zh-cn/web/css/block-size/index.html | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/block-size/index.html b/files/zh-cn/web/css/block-size/index.html new file mode 100644 index 0000000000..d6809a5364 --- /dev/null +++ b/files/zh-cn/web/css/block-size/index.html @@ -0,0 +1,103 @@ +--- +title: 块级尺寸 +slug: Web/CSS/block-size +translation_of: Web/CSS/block-size +--- +<div>{{CSSRef}}{{SeeCompatTable}}</div> + +<div>CSS的block-size属性定义了元素区块的水平宽度和垂直高度,也就是{{cssxref("width")}}或{{cssxref("height")}}属性,它们的大小取决于写入模式,即{{cssxref("writing-mode")}}的值。</div> + +<div>{{EmbedInteractiveExample("pages/css/block-size.html")}} </div> + +<div> </div> + +<p class="hidden">这个交互例子的源码存在Githubd的仓库中。如果你想为这个交互例子的项目做一份贡献,请从 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a>克隆此项目并给我们发送一个pull请求。</p> + +<h2 id="语句">语句</h2> + +<pre class="brush:css no-line-numbers">/* <length> values */ +block-size: 300px; +block-size: 25em; + +/* <percentage> values */ +block-size: 75%; + +/* Keyword values */ +block-size: 25em border-box; +block-size: 75% content-box; +block-size: max-content; +block-size: min-content; +block-size: available; +block-size: fit-content; +block-size: auto; + +/* Global values */ +block-size: inherit; +block-size: initial; +block-size: unset;If the writing mode is vertically oriented, the value of <code style="font-size: 1rem; letter-spacing: -0.00278rem;">block-size</code><span style="background-color: #ffffff; font-family: Arial,x-locale-body,sans-serif; font-size: 1rem; letter-spacing: -0.00278rem;"> relates to the width of the element; otherwise, it relates to the height of the element. A related property is {{cssxref("inline-size")}}, which defines the other dimension of the element.</span> +</pre> + +<p><span style="background-color: #ffffff; font-family: Arial,x-locale-body,sans-serif; font-size: 1rem; letter-spacing: -0.00278rem;">如果写入模式为垂直方向,block-size的值与元素的宽度有关,否则取决于元素的高度。相关的属性是定义了元素的其它大小的</span>{{cssxref("inline-size")}}。</p> + +<h2 id="语句_2">语句</h2> + +<h3 id="值">值</h3> + +<p> <code>block-size</code> <code>属性的值是</code>p{{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"><p class="exampleText">Example text</p> +</pre> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css">.exampleText { + writing-mode: vertical-rl; + background-color: yellow; + block-size: 200px; +}</pre> + +<p>{{EmbedLiveSample("Example")}}</p> + +<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> + <p>{{SpecName("CSS Logical Properties", "#logical-dimension-properties", "block-size")}}</p> + + <p> </p> + </td> + <td>{{Spec2("CSS Logical Properties")}}</td> + <td>初始定义</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性 </h2> + +<div class="hidden">本页面的兼容性表来自于结构型数据,如果你想为此出一份力,请转到<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> ,然后给我们发送pull请求。</div> + +<p>{{Compat("css.properties.block-size")}}</p> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>The mapped physical properties: {{cssxref("width")}} and {{cssxref("height")}}</li> + <li>{{cssxref("writing-mode")}}</li> +</ul> |