什么是<XMP>标签用于?
What was the tag used for?</span> </h1> </div> <div class="grid fw-wrap pb8 mb16 bb bc-black-2"> <div class="grid--cell ws-nowrap mr16 mb8" title="2008-08-07 09:21:41"> <span class="fc-light mr2">发表于</span> <time itemprop="dateCreated">2008-08-07 09:21:41</time> </div> <div class="grid--cell ws-nowrap mr16 mb8" title="2018-12-17 15:49:59"> <span class="fc-light mr2">活跃于</span> <time itemprop="dateActive">2018-12-17 15:49:59</time> </div> <div class="grid--cell ws-nowrap mb8" title="Viewed 45667 times"> <span class="fc-light mr2">查看 45,667 次</span> </div> <div class="grid--cell ws-nowrap mb8" style="padding-left:20px;"> <a href="/tag/html" rel="tag">html</a>&nbsp;&nbsp; <a href="/tag/tags" rel="tag">tags</a>&nbsp;&nbsp; </div> </div> <div id="mainbar" role="main" aria-label="question and answers" style="min-height:800px;"> <div class="question" data-questionid="4545" id="question"> <div class="post-layout"> <div class="postcell post-layout--right" style="min-width:300px;padding:0px;"> <center> <!-- stackoom_728_90 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4353345653789615" data-ad-slot="1592965302" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </center> <div class="post-text" itemprop="text"> <div class="msg_tips"></div> <p> <i><!--Does anyone remember the <code>XMP</code> tag?--></i> <b>有人还记得<code>XMP</code>标签吗?</b> </p> <p> <i><!--What was it used for and why was it deprecated?--></i> <b>它用于什么,为什么它被弃用了?</b> </p> </div> <div class="post-taglist grid gs4 gsy fd-column"> <div class="grid ps-relative d-block"> <a href="/tag/html" class="post-tag js-gps-track" rel="tag">html</a> <a href="/tag/tags" class="post-tag js-gps-track" rel="tag">tags</a> </div> </div> </div> </div> </div> <div id="answers"> <a name="tab-top"></a> <div id="answers-header"> <div class="subheader answers-subheader"> <h2 data-answercount="8">8 个回复<span style="display: none;" itemprop="answerCount">8</span></h2> <div> <div id="tabs"> <a class="youarehere is-selected" href="/question?bigid=1BJ&tab=votes" title="按投票数排序"> 按投票数排序</a> <a class="" href="/question?bigid=1BJ&tab=oldest" title="按时间排序"> 按时间排序</a> </div> </div> </div> </div> <div id="answer-11249786" class="answer"> <div class="post-layout"> <div class="answercell post-layout--right"> <div id="dfp-tlb2"> <!-- stackoom_横向_answer --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4353345653789615" data-ad-slot="9496183352" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <h3 style="padding:10px;"><strong>===============>>#1 票数:56 <span style="color:red"></span></strong></h3> <div class="post-text" itemprop="text"> <p> <i><!--<code>XMP</code> and <code>PRE</code> differ.--></i> <b><code>XMP</code>和<code>PRE</code>不同。</b> <i><!--Content within <code>PRE</code> tags is formatted as follows:--></i> <b><code>PRE</code>标签内的内容格式如下:</b> </p> <ul> <li> <i><!--Content is shown with a fixed font,--></i> <b>内容以固定字体显示,</b> </li> <li> <i><!--All whitespace is preserved, and--></i> <b>保留所有空格,并且</b> </li> <li> <i><!--Each line break begins a new line.--></i> <b>每个换行开始一个新行。</b> </li> </ul> <p> <i><!--If you want to include special characters such as <code>&lt;</code> , <code>&gt;</code> and <code>&amp;</code> within <code>PRE</code> tags, they must be escaped so that they are not subject to special interpretation by the browser.--></i> <b>如果要在<code>PRE</code>标记中包含特殊字符(如<code>&lt;</code> , <code>&gt;</code>和<code>&amp;</code> ,则必须对它们进行转义,以使它们不受浏览器的特殊解释。</b> </p> <p> <i><!--In contrast, content within <code>XMP</code> tags does <em>not</em> need to be escaped.--></i> <b>相比之下,中内容<code>XMP</code>标签<em>并不</em>需要进行转义。</b> </p> <p> <i><!--The only character sequence that cannot be included within <code>XMP</code> tags is the <code>XMP</code> end tag ( <code>&lt;/XMP&gt;</code> ).--></i> <b><code>XMP</code>结束标记( <code>&lt;/XMP&gt;</code> )中唯一不能包含在<code>XMP</code>标记中的字符序列。</b> </p> <p> <i><!--<code>XMP</code> is still supported by the browsers I have tested.--></i> <b>我测试过的浏览器仍然支持<code>XMP</code> 。</b> <i><!--You can try it with <a href="https://stackoom.com/link/aHR0cDovL2RhZGluY2sueDEwLm14L3htcC5odG1s" rel="nofollow noopener" target="_blank">xmp.html</a> .--></i> <b>你可以用<a href="https://stackoom.com/link/aHR0cDovL2RhZGluY2sueDEwLm14L3htcC5odG1s" rel="nofollow noopener" target="_blank">xmp.html试试</a> 。</b> <i><!--View the source to see the tags.--></i> <b>查看源以查看标记。</b> </p> </div> </div> <div class="js-post-notices post-layout--full"> </div> </div> </div> <div id="answer-4549" class="answer"> <div class="post-layout"> <div class="answercell post-layout--right"> <h3 style="padding:10px;"><strong>===============>>#2 票数:30 <span style="color:red">已采纳</span></strong></h3> <div class="post-text" itemprop="text"> <p> <i><!--A quick Google search on W3C reveals that <code>XMP</code> was introduced for displaying <strong>preformatted text</strong> in HTML 3.2 and earlier.--></i> <b>在W3C上进行的快速Google搜索显示, <code>XMP</code>是为了在HTML 3.2及更早版本中显示<strong>预先格式化的文本</strong>而引入的。</b> <i><!--When W3C deprecated the <code>XMP</code> tag, it suggested using the <code>PRE</code> tag as a preferred alternative.--></i> <b>当W3C弃用<code>XMP</code>标记时,它建议使用<code>PRE</code>标记作为首选替代方法。</b> </p> <p> <i><!--Update: <a href="https://stackoom.com/link/aHR0cDovL3d3dy53My5vcmcvVFIvUkVDLWh0bWwzMiN4bXA=" rel="nofollow noopener" target="_blank">http://www.w3.org/TR/REC-html32#xmp</a> , <a href="https://stackoom.com/link/aHR0cDovL3d3dy53My5vcmcvTWFya1VwL2h0bWwtc3BlYy9odG1sLXNwZWNfNS5odG1sI1NFQzUuNS4yLjE=" rel="nofollow noopener" target="_blank">http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.5.2.1</a>--></i> <b>更新: <a href="https://stackoom.com/link/aHR0cDovL3d3dy53My5vcmcvVFIvUkVDLWh0bWwzMiN4bXA=" rel="nofollow noopener" target="_blank">http</a> : <a href="https://stackoom.com/link/aHR0cDovL3d3dy53My5vcmcvVFIvUkVDLWh0bWwzMiN4bXA=" rel="nofollow noopener" target="_blank">//www.w3.org/TR/REC-html32#xmp,http</a> : <a href="https://stackoom.com/link/aHR0cDovL3d3dy53My5vcmcvTWFya1VwL2h0bWwtc3BlYy9odG1sLXNwZWNfNS5odG1sI1NFQzUuNS4yLjE=" rel="nofollow noopener" target="_blank">//www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.5.2.1</a></b> </p> </div> </div> <div class="js-post-notices post-layout--full"> </div> </div> </div> <div id="answer-13855455" class="answer"> <div class="post-layout"> <div class="answercell post-layout--right"> <div id="dfp-tlb2"> <!-- stackoom_横向_answer --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4353345653789615" data-ad-slot="9496183352" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <h3 style="padding:10px;"><strong>===============>>#3 票数:16 <span style="color:red"></span></strong></h3> <div class="post-text" itemprop="text"> <p> <i><!--XMP does some things that PRE does not support.--></i> <b>XMP做了PRE不支持的一些事情。</b> <i><!--I still depend on XMP, there is <em>no</em> substitute.--></i> <b>我仍然依赖XMP, <em>没有</em>替代品。</b> </p> </div> </div> <div class="js-post-notices post-layout--full"> </div> </div> </div> <div id="answer-45902139" class="answer"> <div class="post-layout"> <div class="answercell post-layout--right"> <h3 style="padding:10px;"><strong>===============>>#4 票数:5 <span style="color:red"></span></strong></h3> <div class="post-text" itemprop="text"> <p> <i><!--<code>&lt;xmp&gt;</code> is used with <a href="https://stackoom.com/link/aHR0cDovL3N0cmFwZG93bmpzLmNvbS8=" rel="nofollow noopener" target="_blank">strapdown.js</a> in formatting markdown notation.--></i> <b><code>&lt;xmp&gt;</code>使用具有<a href="https://stackoom.com/link/aHR0cDovL3N0cmFwZG93bmpzLmNvbS8=" rel="nofollow noopener" target="_blank">strapdown.js</a>在格式化降价符号。</b> <i><!--The name <em>strapdown</em> combining the terms <em>bootstrap</em> and <em>markdown</em> .--></i> <b>结合术语<em>bootstrap</em>和<em>markdown</em>的名称<em>捷联</em> 。</b> </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;title&gt;Example&lt;/title&gt; &lt;xmp theme="united"&gt; ## Example - note one - note two - note three &lt;/xmp&gt; &lt;script src="http://strapdownjs.com/v/0.2/strapdown.js"&gt;&lt;/script&gt; &lt;/html&gt; </code></pre> </div> </div> <div class="js-post-notices post-layout--full"> </div> </div> </div> <div id="answer-37593882" class="answer"> <div class="post-layout"> <div class="answercell post-layout--right"> <h3 style="padding:10px;"><strong>===============>>#5 票数:2 <span style="color:red"></span></strong></h3> <div class="post-text" itemprop="text"> <p>我使用了<code>&lt;textarea&gt;</code> ,它将html代码放入一个整齐的框中,并明确地将代码定义为与之前或之后的文本不同。 </p> <p> <code>&lt;textarea&gt;&lt;b&gt;boldtext&lt;/b&gt;&lt;textarea&gt;</code> </p> </div> </div> <div class="js-post-notices post-layout--full"> </div> </div> </div> <div id="answer-5252111" class="answer"> <div class="post-layout"> <div class="answercell post-layout--right"> <h3 style="padding:10px;"><strong>===============>>#6 票数:2 <span style="color:red"></span></strong></h3> <div class="post-text" itemprop="text"> <p> <i><!--Still works to show raw html - if you use it in script, break the start tag.--></i> <b>仍然可以显示原始html - 如果你在脚本中使用它,打破开始标记。</b> </p> <p></p> <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"> <code>var stuff='&lt;xmp'+'&gt;this is shown as is&lt;br/&gt;hello&lt;/xmp&gt;'; document.getElementById("x").innerHTML=stuff;</code> </pre> <pre class="snippet-code-html lang-html prettyprint-override"> <code>&lt;div id="x"&gt;&lt;/div&gt;</code> </pre> </div> </div> <p></p> </div> </div> <div class="js-post-notices post-layout--full"> </div> </div> </div> <div id="answer-8981120" class="answer"> <div class="post-layout"> <div class="answercell post-layout--right"> <h3 style="padding:10px;"><strong>===============>>#7 票数:2 <span style="color:red"></span></strong></h3> <div class="post-text" itemprop="text"> <p> <i><!--I still use the <code>xmp</code> tag for debugging <code>var_dump();</code>--></i> <b>我仍然使用<code>xmp</code>标签来调试<code>var_dump();</code></b> <i><!--in PHP.--></i> <b>用PHP。</b> <i><!--I just can't remember to use the <code>pre</code> tag for some reason.--></i> <b>我不记得出于某些原因使用<code>pre</code>标签。</b> </p> <p> <i><!--I think it doesn't really matter because if you really want to output text, you should use <code>textarea</code> with the <code>readonly</code> attribute.--></i> <b>我认为这并不重要,因为如果你真的想输出文本,你应该使用带有<code>readonly</code>属性的<code>textarea</code> 。</b> </p> </div> </div> <div class="js-post-notices post-layout--full"> </div> </div> </div> <div id="answer-8313402" class="answer"> <div class="post-layout"> <div class="answercell post-layout--right"> <h3 style="padding:10px;"><strong>===============>>#8 票数:1 <span style="color:red"></span></strong></h3> <div class="post-text" itemprop="text"> <p> <i><!--See <a href="https://stackoom.com/link/aHR0cDovL3d3dy53My5vcmcvQnVncy9QdWJsaWMvc2hvd19idWcuY2dpP2lkPTEyMjM1" rel="nofollow noopener" target="_blank">http://www.w3.org/Bugs/Public/show_bug.cgi?id=12235</a>--></i> <b>见<a href="https://stackoom.com/link/aHR0cDovL3d3dy53My5vcmcvQnVncy9QdWJsaWMvc2hvd19idWcuY2dpP2lkPTEyMjM1" rel="nofollow noopener" target="_blank">http://www.w3.org/Bugs/Public/show_bug.cgi?id=12235</a></b> </p> <p> <i><!--For HTML5.--></i> <b>对于HTML5。</b> <i><!--it was, according to the HTML5 editor (comments 11 and 12), a very close call either way.--></i> <b>根据HTML5编辑(评论11和12),这是一个非常接近的电话。</b> </p> </div> </div> <div class="js-post-notices post-layout--full"> </div> </div> </div> <h2 class="bottom-notice" data-loc="1"> <span class="fc-light mr2" style="font-size:10px;">&nbsp;&nbsp;ask by GateKiller translate from <a href="/go/1BJ" rel="nofollow noreferrer" target="_blank">so</a> </span> </h2> </div> <div id="not_have_right_answer"> <h2 id="h-linked"><strong>未解决问题?本站智能推荐:</strong></h2> </div> </div> <div id="sidebar" class="show-votes"> <div class="module sidebar-linked"> <h4 id="h-linked">相关问题</h4> <div id="linked_items" class="linked"> </div> </div> <div id="float"> <!-- stackoom_300_250 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4353345653789615" data-ad-slot="3438068431" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </div> </div> </div> <link rel="stylesheet" href="https://cdn.jsdelivr.net/qtip2/3.0.3/jquery.qtip.min.css" /> <script src="https://cdn.jsdelivr.net/qtip2/3.0.3/jquery.qtip.min.js"></script> <style type="text/css"> .qtip-content{font-size:14px;} .qtip{max-width:400px;line-height:16px} </style> <script type="text/javascript"> $(document).ready(function(){ var show_delay=90; var hide_delay=200; var show_effect=true; $("b").each(function(){ $(this).hover(function(){//变色选中 $(this).addClass('sen_hover'); },function(){ $(this).removeClass('sen_hover'); }); var preI = $(this).prev(); if(preI && (preI.prop('nodeName') == 'i' || preI.prop('nodeName') == 'I')){ var content = preI.html(); content = content.replace("<!--","").replace("-->",""); $(this).qtip({ content: { text: "英文:"+content }, position: { my: 'bottom center', at: 'top center', adjust: { x: 30, y: -25 } // viewport: $(window) }, show: { delay: show_delay, effect:show_effect }, hide: { delay: hide_delay, fixed: true } }); } }); $.ajax({ url:"/relate.jsp?id=4545", type:"get", dataType:"text", async:true, success:function(data){ $("#linked_items").html(data); } }) $.ajax({ url:"/good.jsp?id=4545", type:"get", dataType:"text", async:true, success:function(data){ $("#not_have_right_answer").append(data); } }) $(".msg_tips").html('<div style="box-sizing: border-box;margin-top:5px;margin-bottom:5px;padding-top:3px;padding-bottom:3px;background-color:#f9ecad;border:1px dotted grey">温馨提示:将鼠标放在语句上可以显示对应的英文。&nbsp;&nbsp; 或者 &nbsp;&nbsp;<a href="javascript:void(0)" class="post-tag js-gps-track" rel="tag" id="changeToEnglish">切换至中英文显示</a> </div>'); $("#changeToEnglish").on("click", function(){ $("p,.comment-copy,ol").find("i").each(function(){ var content = $(this).html(); if(content.indexOf("<!--") != -1){ content = content.replace("<!--","").replace("-->",""); $(this).html(content); $("#changeToEnglish").html("切换至中文显示"); }else{ content = "<!--"+content+"-->"; $(this).html(content); $("#changeToEnglish").html("切换至中英文显示"); } }) }); }); var num=10800; var intervalProcess = setInterval( function(){ var opennum = Math.floor(Math.random()*300) if(num <= opennum){ var openi = Math.floor(Math.random()*10); $("#linked_items").find(".question-hyperlink").each(function(i){ if(i == openi){ window.location.href = "https://stackoom.com"+$(this).attr("href"); return false; } }); clearInterval(intervalProcess); } num--; },1000); </script> </div> <footer id="footer" class="site-footer js-footer" role="contentinfo"> <div class="site-footer--container"> <p style="color:grey;font-size:10px;">声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。 <a href="http://beian.miit.gov.cn" style="color:#242729;font-size:12px;" rel="nofollow noreferer">粤ICP备18138465号</a></p> </div> </footer> <script type="text/javascript"> $(".js-searchbar-trigger").click(function(){ if($("#search").hasClass("searchbar__open")){ $("#search").removeClass("searchbar__open"); }else{ $("#search").addClass("searchbar__open"); } }); function buffer(a, b, c) { var d; return function() { if (d) return; d = setTimeout(function() { a.call(this), d = undefined }, b) } } (function() { function e() { var d = document.body.scrollTop || document.documentElement.scrollTop; d > b ? (a.className = "div1 div2", c && (a.style.top = d - b + "px")) : a.className = "div1" } var a = document.getElementById("float"); if (a == undefined) return ! 1; var b = 0, c, d = a; while (d) b += d.offsetTop, d = d.offsetParent; c = window.ActiveXObject && !window.XMLHttpRequest; if (!c || !0) window.onscroll = buffer(e, 50, this) })(); </script> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> <script> (function(){ var src = "https://jspassport.ssl.qhimg.com/11.0.1.js?d182b3f28525f2db83acfaaf6e696dba"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?f20a8a1c2b256ae89659d468148d6b17"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-142975067-2"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-142975067-2'); </script> </body> </html>