mozilla

版本 170007 / border

  • 版本网址缩略名: CSS/border
  • 版本标题: border
  • 版本 id: 170007
  • 创建于:
  • 创建者: Zmylxb
  • 是否是当前版本?
  • 评论 New page: <breadcrumbs></breadcrumbs> __NOTOC__ {{CSSRef}} == Summary == The <code>border</code> property is a shorthand property for setting the individual border property values in a single place...
标签: 

修订内容

{{ CSSRef() }}

Summary

The border property is a shorthand property for setting the individual border property values in a single place in the style sheet. border can be used to set the values for one or more of: {{ Cssxref("border-width") }}, {{ Cssxref("border-style") }}, {{ Cssxref("border-color") }}.

  • {{ Xref_cssinitial() }}: see individual properties for details
  • Applies to: all elements
  • {{ Xref_cssinherited() }}: no
  • Percentages: N/A
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: see individual properties

Syntax

border: [border-width || border-style || border-color | inherit] ;

Values

border-width
See {{ Cssxref("border-width") }}.
border-style 
See {{ Cssxref("border-style") }}.
border-color 
See {{ Cssxref("border-color") }}.

Examples

{{ CSSRefExampleLink("border") }}

element { 
    border: 1px solid #000;
}

Notes

While the {{ Cssxref("border-width") }}, {{ Cssxref("border-style") }}, and {{ Cssxref("border-color") }} properties accept up to four values, this property only accepts one value for each property.

Specifications

Browser compatibility

Browser Lowest Version
Internet Explorer 4
Firefox 1
Netscape 4
Opera 3.5

See also

{{ CSS_Reference:Border() }}

{{ languages( { "en": "en/CSS/border", "fr": "fr/CSS/border", "pl": "pl/CSS/border", "es": "es/CSS/border" } ) }}

修订版来源

<p> {{ CSSRef() }}
</p>
<h3 id="Summary" name="Summary"> Summary </h3>
<p>The <code>border</code> property is a shorthand property for setting the individual border property values in a single place in the style sheet. <code>border</code> can be used to set the values for one or more of: {{ Cssxref("border-width") }}, {{ Cssxref("border-style") }}, {{ Cssxref("border-color") }}.
</p>
<ul><li> {{ Xref_cssinitial() }}: see individual properties for details
</li><li> Applies to: all elements
</li><li> {{ Xref_cssinherited() }}: no
</li><li> Percentages: N/A
</li><li> Media: {{ Xref_cssvisual() }}
</li><li> {{ Xref_csscomputed() }}: see individual properties
</li></ul>
<h3 id="Syntax" name="Syntax"> Syntax </h3>
<pre class="eval">border: [<i>border-width</i> || <i>border-style</i> || <i>border-color</i> | <i>inherit</i>] ;
</pre>
<h3 id="Values" name="Values"> Values </h3>
<dl><dt> border-width</dt><dd> See {{ Cssxref("border-width") }}.
</dd><dt> border-style </dt><dd> See {{ Cssxref("border-style") }}.
</dd><dt> border-color </dt><dd> See {{ Cssxref("border-color") }}.
</dd></dl>
<h3 id="Examples" name="Examples"> Examples </h3>
<p>{{ CSSRefExampleLink("border") }}
</p>
<pre>element { 
    border: 1px solid #000;
}
</pre>
<h3 id="Notes" name="Notes"> Notes </h3>
<p>While the {{ Cssxref("border-width") }}, {{ Cssxref("border-style") }}, and {{ Cssxref("border-color") }} properties accept up to four values, this property only accepts one value for each property.
</p>
<h3 id="Specifications" name="Specifications"> Specifications </h3>
<ul><li> <a class="external" href="http://www.w3.org/TR/CSS1#border">CSS 1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/CSS21/box.html#box-border-area">CSS 2.1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/css3-background/#the-border-shorthands">CSS 3</a>
</li></ul>
<h3 id="Browser_compatibility" name="Browser_compatibility"> Browser compatibility </h3>
<table class="standard-table"> <tbody><tr> <th>Browser</th> <th>Lowest Version</th> </tr> <tr> <td>Internet Explorer</td> <td>4</td> </tr> <tr> <td>Firefox</td> <td>1</td> </tr> <tr> <td>Netscape</td> <td>4</td> </tr> <tr> <td>Opera</td> <td>3.5</td> </tr>
</tbody></table>
<h3 id="See_also" name="See_also"> See also </h3>
<p>{{ CSS_Reference:Border() }}
</p>{{ languages( { "en": "en/CSS/border", "fr": "fr/CSS/border", "pl": "pl/CSS/border", "es": "es/CSS/border" } ) }}
恢复到这个版本