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/border-top-width | |
| 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/border-top-width')
| -rw-r--r-- | files/zh-cn/web/css/border-top-width/index.html | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/border-top-width/index.html b/files/zh-cn/web/css/border-top-width/index.html new file mode 100644 index 0000000000..b8b80400d7 --- /dev/null +++ b/files/zh-cn/web/css/border-top-width/index.html @@ -0,0 +1,140 @@ +--- +title: border-top-width +slug: Web/CSS/border-top-width +translation_of: Web/CSS/border-top-width +--- +<div>{{CSSRef}}</div> + +<p>css属性 <strong><code>border-top-width</code></strong> 是用于设置盒模型的上边框的宽度</p> + +<div>{{EmbedInteractiveExample("pages/css/border-top-width.html")}}</div> + + + +<h2 id="Syntax" name="Syntax">Syntax</h2> + +<pre class="brush:css no-line-numbers">/* Keyword values */ +border-top-width: thin; +border-top-width: medium; +border-top-width: thick; + +/* <length> values */ +border-top-width: 10em; +border-top-width: 3vmax; +border-top-width: 6px; + +/* Global keywords */ +border-top-width: inherit; +border-top-width: initial; +border-top-width: unset; +</pre> + +<h3 id="Values">Values</h3> + +<dl> + <dt><code><br-width></code></dt> + <dd>上边框的宽度属性的有效值要么是一个具体的非负数,要么是一个关键字。如果是关键字,必须是一下几种: + <table class="standard-table"> + <tbody> + <tr> + <td style="vertical-align: middle;"><code>thin</code></td> + <td style="vertical-align: middle;"> + <div style="margin: 0.5em; width: 3em; height: 3em; border-top-style: solid; border-top-width: thin; background-color: palegreen;"> </div> + </td> + <td style="vertical-align: middle;">A thin border</td> + </tr> + <tr> + <td style="vertical-align: middle;"><code>medium</code></td> + <td style="vertical-align: middle;"> + <div style="margin: 0.5em; width: 3em; height: 3em; border-top-style: solid; border-top-width: medium; background-color: palegreen;"> </div> + </td> + <td style="vertical-align: middle;">A medium border</td> + </tr> + <tr> + <td style="vertical-align: middle;"><code>thick</code></td> + <td style="vertical-align: middle;"> + <div style="margin: 0.5em; width: 3em; height: 3em; border-top-style: solid; border-top-width: thick; background-color: palegreen;"> </div> + </td> + <td style="vertical-align: middle;">A thick border</td> + </tr> + </tbody> + </table> + + <div class="note"> + <p><strong>Note:</strong> Because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. Nevertheless, they always follow the pattern <code>thin ≤ medium ≤ thick</code>, and the values are constant within a single document.</p> + </div> + </dd> +</dl> + +<h3 id="Formal_syntax">Formal syntax</h3> + +<pre class="syntaxbox">{{csssyntax}}</pre> + +<h2 id="Example">Example</h2> + +<h3 id="HTML">HTML</h3> + +<pre class="brush: html"><div>Element 1</div> +<div>Element 2</div></pre> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css">div { + border: 1px solid red; + margin: 1em 0; +} + +div:nth-child(1) { + border-top-width: thick; +} +div:nth-child(2) { + border-top-width: 2em; +}</pre> + +<h3 id="Result">Result</h3> + +<p>{{EmbedLiveSample('Example', '100%')}}</p> + +<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 Backgrounds', '#the-border-width', 'border-top-width')}}</td> + <td>{{Spec2('CSS3 Backgrounds')}}</td> + <td>No significant change.</td> + </tr> + <tr> + <td>{{SpecName('CSS2.1', 'box.html#border-width-properties', 'border-top-width')}}</td> + <td>{{Spec2('CSS2.1')}}</td> + <td>No significant change.</td> + </tr> + <tr> + <td>{{SpecName('CSS1', '#border-left-width', 'border-top-width')}}</td> + <td>{{Spec2('CSS1')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<p>{{cssinfo}}</p> + +<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("css.properties.border-top-width")}}</p> + +<h2 id="See_also" name="See_also">See also</h2> + +<ul> + <li>The other border-width-related CSS properties: {{Cssxref("border-left-width")}}, {{Cssxref("border-right-width")}}, {{Cssxref("border-bottom-width")}}, and {{Cssxref("border-width")}}.</li> + <li>The other border-top-related CSS properties: {{Cssxref("border")}}, {{Cssxref("border-top")}}, {{Cssxref("border-top-style")}}, and {{Cssxref("border-top-color")}}.</li> +</ul> |
