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/html/element/samp | |
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/html/element/samp')
-rw-r--r-- | files/zh-cn/web/html/element/samp/index.html | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/samp/index.html b/files/zh-cn/web/html/element/samp/index.html new file mode 100644 index 0000000000..182e4c2e38 --- /dev/null +++ b/files/zh-cn/web/html/element/samp/index.html @@ -0,0 +1,95 @@ +--- +title: <samp> +slug: Web/HTML/Element/samp +translation_of: Web/HTML/Element/samp +--- +<h2 id="概述">概述</h2> + +<p><span style="font-family: courier new;"><samp></span> 元素用于标识计算机程序输出,通常使用浏览器缺省的 monotype 字体(例如 Lucida Console)。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row"><a href="/en-US/docs/HTML/Content_categories" title="HTML/Content_categories">内容分类</a></th> + <td><a href="/en/HTML/Content_categories#Flow_content" style="line-height: 22px;" title="en/HTML/Content categories#Flow content">Flow content</a><span style="line-height: 22px;">, </span><a href="/en/HTML/Content_categories#Phrasing_content" style="line-height: 22px;" title="en/HTML/Content categories#Phrasing content">phrasing content</a>, palpable content.</td> + </tr> + <tr> + <th scope="row">允许内容</th> + <td><a href="/en/HTML/Content_categories#Phrasing_content" style="line-height: 22px;" title="en/HTML/Content categories#Phrasing content">Phrasing content</a>.</td> + </tr> + <tr> + <th scope="row">遗漏标签</th> + <td>{{no_tag_omission}}</td> + </tr> + <tr> + <th scope="row">允许的父级元素</th> + <td>Any element that accepts <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">phrasing content</a>.</td> + </tr> + <tr> + <th scope="row">DOM 接口</th> + <td>{{domxref("HTMLElement")}}</td> + </tr> + </tbody> +</table> + +<h2 id="属性">属性</h2> + +<p><span style="line-height: 21px;">该元素只包含 </span><a href="https://developer.mozilla.org/en-US/docs/HTML/Global_attributes" style="line-height: 21px;" title="HTML/Global attributes">全局属性</a><span style="line-height: 21px;">。</span></p> + +<h2 id="DOM_接口">DOM 接口</h2> + +<p>该元素实现了 <code><a href="/en/DOM/element" title="en/DOM/element">HTMLElement</a></code> 接口。</p> + +<div class="note"> +<p><strong>Implementation note: </strong>基于 Gecko 1.9.2 及以上,Firefox 还为该元素实现了<a href="/en/DOM/span" title="en/DOM/span"><span style="font-family: courier new;">HTMLSpanElement</span></a> 接口。</p> +</div> + +<h2 id="示例">示例</h2> + +<pre class="brush: html"><p>Regular text. <samp>This is sample text.</samp> Regular text.</p> +</pre> + +<h3 id="结果">结果</h3> + +<p>Regular text. <samp>This is sample text.</samp> Regular text.</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>{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-samp-element', '<samp>')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-samp-element', '<samp>')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('HTML4.01', 'struct/text.html#h-9.2.1', '<samp>')}}</td> + <td>{{Spec2('HTML4.01')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="注意">注意</h2> + +<p>可以使用 CSS 选择器 <code>samp</code> 定义规则来覆盖浏览器的缺省字体。不过,用户设置的偏好可能会优先于指定的 CSS 使用。</p> + +<h2 id="另请参阅">另请参阅</h2> + +<ul> + <li><a href="/en/HTML/Element/code" title="en/HTML/Element/code">HTML Code Element</a></li> +</ul> + +<div>{{ HTMLRef }}</div> |