HTML 璁剧疆鈫� 瀛楀彿: 棰滆壊: 鑳屾櫙鑹�: 榛樿
HTML鍙傝€� > HTML鍏冪礌
鏁翠綋鏋勯€犲厓绱�鏂囧瓧鍏冪礌鏍峰紡涓庨厤缃厓绱�鍒楄〃鍏冪礌閾炬帴鍏冪礌琛ㄥ崟鍏冪礌琛ㄦ牸鍏冪礌鍥剧墖涓庡璞″厓绱�妗嗘灦鍏冪礌娉ㄩ煶鏍囨敞鍏冪礌鍏跺畠鍏冪礌
> 鏂囧瓧鍏冪礌
abbracronymemstrongdfnkbdsampcodevarciteblockquoteqsupsubpbrinsdelpreplaintextxmp
> 元素xmp
xmp
适用DTD:   适用浏览器:All
释义
保持文件格式且不运行元素标签(example)

语法
<xmp 属性="属性值">~标签内容~</xmp>

说明
该元素可以保持文字间的相对位置,将要显示的文字格式完全对应地显示在浏览器中,固定大小的字型空格及空白行不会被省略。这一点和pre元素是相同的。
xmp会忽略其开始标签与终止标签之间的任何元素标签,所有的HTML标记都会被忽略,但其终止标签及其终止标签之后的元素则不受影响。这一点与plaintext极相似但又不全相同
xmp在HTML 4.0后已被列入非标准元素(已从HTML 4.0标准中去除),建议以pre取代
xmp元素中的文字默认不会自动换行,如果一行文字过长,浏览器将产生水平滚动条。xmp元素的标签内容也会以等宽字体显示

属性
属性 属性值 说明
① 通用属性:id、class、title、style、dir、lang、xml:lang 查看
娉細W3C闈炴帹鑽愬睘鎬ф垨闈炴爣鍑嗗睘鎬� 浠匵HTML閫傜敤 榛樿鍊�

示范
<xmp>格式化文本</xmp>

范例
下面的例子显示了XHTML文件基础结构: 运行打印
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>元素xmp</title>
</head>
<body>
<xmp>The PRE element tells visual user agents that the enclosed text is "preformatted". When handling preformatted text, visual user agents:
May leave white space intact.
May render text with a fixed-pitch font.
May disable automatic word wrap.
Must not disable bidirectional processing.
Non-visual user agents are not required to respect extra white space in the content of a PRE element.

The DTD fragment above indicates which elements may not appear within a PRE declaration. This is the same as in HTML 3.2, and is intended to preserve constant line spacing and column alignment for text rendered in a fixed pitch font. Authors are discouraged from altering this behavior through style sheets.
</xmp>
From<cite>HTML 4.01 Specification</cite>
</body>
</html>

参阅
pre
plaintext



© 2008 liuming lium03@tom.com
395310500
, All Rights Reserved.