元素plaintext

HTML文件的基本结构

plaintext
适用DTD:   适用浏览器:-Opera
释义 不运行元素标签(plaintext)

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

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

属性
属性 属性值 说明
① 通用属性:id、class、title、style、dir、lang、xml:lang 查看
nbsp;

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

范例
下面的例子显示了XHTML文件基础结构: 运行打印
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>元素plaintext</title>
</head>
<body>
<plaintext>
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.
</plaintext>From<cite>HTML 4.01 Specification</cite>
</body>
</html>

参阅
pre
xmp