Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 712943 of Element.clientTop

  • 版本网址缩略名: Web/API/Element.clientTop
  • 版本标题: Element.clientTop
  • 版本 id: 712943
  • 创建于:
  • 创建者: AlexChao
  • 是否是当前版本?
  • 评论
标签: 

修订内容

{{ Fx_minversion_header(3) }} {{ APIRef() }}

一个元素顶部边框的宽度(以像素表示)。顶部外边距或内边距。clientTop 是只读的。

基于 Gecko 的应用从 Gecko 1.9(Firefox 3 {{ Bug(111207) }})开始支持 clientTop。该属性在 Firefox 2 或更早的版本中不被支持。

语法

vartop = element.clientTop;
 

示例

padding-top

Gentle, individualistic and very loyal, Birman cats fall between Siamese and Persian in character. If you admire cats that are non aggressive, that enjoy being with humans and tend to be on the quiet side, you may well find that Birman cats are just the felines for you.

Image:BirmanCat.jpgAll Birmans have colorpointed features, dark coloration of the face, ears, legs and tail.

Cat image and text coming from www.best-cat-art.com

padding-bottom

LeftTopRightBottommargin-topmargin-bottomborder-topborder-bottom

 

备注

clientTop 首次出现于 MS IE DHTML 对象模型中。

相关链接

  • {{ MSDN("ms533565", "clientTop Property") }}
  • {{ MSDN("ms530302", "Measuring Element Dimension and Location") }}

修订版来源

<p>{{ Fx_minversion_header(3) }} {{ APIRef() }}</p>
<p>一个元素顶部边框的宽度(以像素表示)。顶部外边距或内边距。<code>clientTop</code>&nbsp;是只读的。</p>
<p>基于&nbsp;<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/en/Gecko">Gecko</a>&nbsp;的应用从 Gecko 1.9(<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/en/Firefox_3">Firefox 3</a>&nbsp;{{ Bug(111207) }})开始支持 clientTop。该属性在 Firefox 2 或更早的版本中不被支持。</p>
<h2 id="Syntax" name="Syntax" style="margin-bottom: 20px; line-height: 30px; font-size: 2.14285714285714rem;">语法</h2>
<pre class="eval  language-html" data-number="" style="padding: 1em 0px 1em 30px; font-size: 14px; white-space: normal; word-spacing: 0px; color: rgb(77, 78, 83); background-repeat: initial;">
<code class="language-html" style="direction: ltr; white-space: pre; word-spacing: normal; word-break: normal; tab-size: 4;">vartop = element.clientTop;</code></pre>
<div class="line-number" data-start="1" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; pointer-events: none; line-height: inherit; top: 0px; background: 0px 0px;">
 &nbsp;</div>
<h2 id="Example" name="Example" style="margin-bottom: 20px; line-height: 30px; font-size: 2.14285714285714rem;">示例</h2>
<div id="offsetContainer" style="margin-top: 26px; margin-bottom: 26px; border: 4px dashed black; color: black; position: absolute; left: 260px; background-color: rgb(255, 255, 204);">
 <div id="idDiv" style="margin: 24px 29px; padding-right: 28px; padding-left: 28px; border: 24px solid black; width: 199px; height: 102px; overflow: auto; font-family: Arial, sans-serif; font-size: 13px !important; background-color: white;">
  <p id="PaddingTopLabel" style="margin-bottom: 0px; text-align: center; font-style: italic; font-weight: bold;">padding-top</p>
  <p>Gentle, individualistic and very loyal, Birman cats fall between Siamese and Persian in character. If you admire cats that are non aggressive, that enjoy being with humans and tend to be on the quiet side, you may well find that Birman cats are just the felines for you.</p>
  <p><span style="float: right;"><img alt="Image:BirmanCat.jpg" /></span>All Birmans have colorpointed features, dark coloration of the face, ears, legs and tail.</p>
  <p>Cat image and text coming from&nbsp;<a class="external external-icon" href="https://www.best-cat-art.com/">www.best-cat-art.com</a></p>
  <p id="PaddingBottomLabel" style="margin-bottom: 0px; text-align: center; font-style: italic; font-weight: bold;">padding-bottom</p>
 </div>
 <span style="position: absolute; left: -32px; top: 85px; color: blue; font-weight: bold; font-family: Arial, sans-serif; font-size: 13px !important;">Left</span><span style="position: absolute; left: 170px; top: -24px; color: blue; font-weight: bold; font-family: Arial, sans-serif; font-size: 13px !important;">Top</span><span style="position: absolute; left: 370px; top: 85px; color: blue; font-weight: bold; font-family: Arial, sans-serif; font-size: 13px !important;">Right</span><span style="position: absolute; left: 164px; top: 203px; color: blue; font-weight: bold; font-family: Arial, sans-serif; font-size: 13px !important;">Bottom</span><span style="position: absolute; left: 143px; top: 5px; font-style: italic; font-weight: bold; font-family: Arial, sans-serif; font-size: 13px !important;">margin-top</span><span style="position: absolute; left: 138px; top: 175px; font-style: italic; font-weight: bold; font-family: Arial, sans-serif; font-size: 13px !important;">margin-bottom</span><span style="position: absolute; left: 143px; top: 27px; color: white; font-style: italic; font-weight: bold; font-family: Arial, sans-serif; font-size: 13px !important;">border-top</span><span style="position: absolute; left: 138px; top: 153px; color: white; font-style: italic; font-weight: bold; font-family: Arial, sans-serif; font-size: 13px !important;">border-bottom</span></div>
<p style="margin-top: 270px;">&nbsp;</p>
<h2 id="Notes" name="Notes" style="margin-bottom: 20px; line-height: 30px; font-size: 2.14285714285714rem;">备注</h2>
<p><code>clientTop</code>&nbsp;首次出现于 MS IE DHTML 对象模型中。</p>
<h2 id="References" name="References" style="margin-bottom: 20px; line-height: 30px; font-size: 2.14285714285714rem;">相关链接</h2>
<ul>
 <li>{{ MSDN("ms533565", "clientTop Property") }}</li>
 <li>{{ MSDN("ms530302", "Measuring Element Dimension and Location") }}</li>
</ul>
恢复到这个版本