From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- files/zh-tw/web/html/element/code/index.html | 138 +++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 files/zh-tw/web/html/element/code/index.html (limited to 'files/zh-tw/web/html/element/code') diff --git a/files/zh-tw/web/html/element/code/index.html b/files/zh-tw/web/html/element/code/index.html new file mode 100644 index 0000000000..d32ed8c474 --- /dev/null +++ b/files/zh-tw/web/html/element/code/index.html @@ -0,0 +1,138 @@ +--- +title: +slug: Web/HTML/Element/code +translation_of: Web/HTML/Element/code +--- +

HTML Code 元素<code>)表現出電腦程式碼的片段。通常,它會由瀏覽器預設的 monospace 字體顯示出來。

+ + + + + + + + + + + + + + + + + + + + + + + + +
內容分類流內容段落式内容、捫及內容
允許內容段落式内容.
標籤省略{{no_tag_omission}}
允許父元素任何允許段落式内容的元素。
DOM 介面{{domxref("HTMLElement")}}。Gecko 1.9.2 (Firefox 4) 以前,Firefox 針對這個元素使用 {{domxref("HTMLSpanElement")}} 介面實做。
+ +

屬性

+ +

這個元素只支援全域屬性

+ +

例子

+ +
<p> Regular text. <code> This is code. </code> Regular text. </p>
+
+ +

結果

+ +

Regular text. This is code. Regular text.

+ +

註記

+ +

CSS 的 code 選擇器設定可以透過蓋過瀏覽器預設,而用戶個人設定可以蓋過 CSS 設定。

+ +

規範

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
規範狀態註解
{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-code-element', '<code>')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-code-element', '<code>')}}{{Spec2('HTML5 W3C')}} 
{{SpecName('HTML4.01', 'struct/text.html#h-9.2.1', '<code>')}}{{Spec2('HTML4.01')}} 
+ +

瀏覽器相容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
特徵ChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
基本支援1.0{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
特徵AndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
基本支援{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + + +
{{HTMLRef}}
-- cgit v1.2.3-54-g00ecf