A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/zh-CN/docs/Web/HTML/Reference/Elements/code below:

<code>ï¼šè¡Œå†…ä»£ç å…ƒç´ - HTMLï¼ˆè¶…æ–‡æœ¬æ ‡è®°è¯è¨€ï¼‰ | MDN

<code>:行内代码元素

Baseline Widely available

HTML <code> 元素为其显示的内容添加用以表明其中的文本是一段简短的计算机代码的样式。默认情况下,内容文本使用用户代理默认的等宽字体显示。

尝试一下
<p>
  The <code>push()</code> method adds one or more elements to the end of an
  array and returns the new length of the array.
</p>
code {
  background-color: #eee;
  border-radius: 3px;
  font-family: courier, monospace;
  padding: 0 3px;
}
属性

此元素仅包含全局属性。

示例

这是一段包含 <code> 的文字:

<p>
  函数
  <code>selectAll()</code>
  将高亮显示输入字段中的所有文本,以便用户可以复制或删除文本。
</p>
结果 备注

要表示多行代码,可在 <pre> 元素中封装 <code> 元素。<code> 元素本身只能表示一段代码短语或一行代码。

可为 code 选择器定义 CSS 规则,以覆盖浏览器的默认字体。用户设置的首选项可能优先于指定的 CSS。

技术概要 规范 浏览器兼容性 参见

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4